diff options
Diffstat (limited to 'drivers/staging/most/cdev/cdev.c')
-rw-r--r-- | drivers/staging/most/cdev/cdev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c index 4569838f27a0..ea64aabda94e 100644 --- a/drivers/staging/most/cdev/cdev.c +++ b/drivers/staging/most/cdev/cdev.c @@ -447,7 +447,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, c = kzalloc(sizeof(*c), GFP_KERNEL); if (!c) { retval = -ENOMEM; - goto error_alloc_channel; + goto err_remove_ida; } c->devno = MKDEV(comp.major, current_minor); @@ -463,7 +463,7 @@ static int comp_probe(struct most_interface *iface, int channel_id, retval = kfifo_alloc(&c->fifo, cfg->num_buffers, GFP_KERNEL); if (retval) { pr_info("failed to alloc channel kfifo"); - goto error_alloc_kfifo; + goto err_del_cdev_and_free_channel; } init_waitqueue_head(&c->wq); mutex_init(&c->io_mutex); @@ -475,18 +475,18 @@ static int comp_probe(struct most_interface *iface, int channel_id, if (IS_ERR(c->dev)) { retval = PTR_ERR(c->dev); pr_info("failed to create new device node %s\n", name); - goto error_create_device; + goto err_free_kfifo_and_del_list; } kobject_uevent(&c->dev->kobj, KOBJ_ADD); return 0; -error_create_device: +err_free_kfifo_and_del_list: kfifo_free(&c->fifo); list_del(&c->list); -error_alloc_kfifo: +err_del_cdev_and_free_channel: cdev_del(&c->cdev); kfree(c); -error_alloc_channel: +err_remove_ida: ida_simple_remove(&comp.minor_id, current_minor); return retval; } |