if (down_interruptible (&dvb_i2c_mutex))
return NULL;
- if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL)))
+ if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL))) {
+ up (&dvb_i2c_mutex);
return NULL;
+ }
INIT_LIST_HEAD(&i2c->list_head);
INIT_LIST_HEAD(&i2c->client_list);
if (down_interruptible (&dvb_i2c_mutex))
return -ERESTARTSYS;
- if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL)))
+ if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL))) {
+ up(&dvb_i2c_mutex);
return -ENOMEM;
+ }
entry->owner = owner;
entry->attach = attach;