diff options
Diffstat (limited to 'drivers/staging/most/cdev/cdev.c')
-rw-r--r-- | drivers/staging/most/cdev/cdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c index 0b48677fa958..27d58b55b810 100644 --- a/drivers/staging/most/cdev/cdev.c +++ b/drivers/staging/most/cdev/cdev.c | |||
@@ -453,7 +453,9 @@ static int comp_probe(struct most_interface *iface, int channel_id, | |||
453 | c->devno = MKDEV(comp.major, current_minor); | 453 | c->devno = MKDEV(comp.major, current_minor); |
454 | cdev_init(&c->cdev, &channel_fops); | 454 | cdev_init(&c->cdev, &channel_fops); |
455 | c->cdev.owner = THIS_MODULE; | 455 | c->cdev.owner = THIS_MODULE; |
456 | cdev_add(&c->cdev, c->devno, 1); | 456 | retval = cdev_add(&c->cdev, c->devno, 1); |
457 | if (retval < 0) | ||
458 | goto err_free_c; | ||
457 | c->iface = iface; | 459 | c->iface = iface; |
458 | c->cfg = cfg; | 460 | c->cfg = cfg; |
459 | c->channel_id = channel_id; | 461 | c->channel_id = channel_id; |
@@ -485,6 +487,7 @@ error_create_device: | |||
485 | list_del(&c->list); | 487 | list_del(&c->list); |
486 | error_alloc_kfifo: | 488 | error_alloc_kfifo: |
487 | cdev_del(&c->cdev); | 489 | cdev_del(&c->cdev); |
490 | err_free_c: | ||
488 | kfree(c); | 491 | kfree(c); |
489 | error_alloc_channel: | 492 | error_alloc_channel: |
490 | ida_simple_remove(&comp.minor_id, current_minor); | 493 | ida_simple_remove(&comp.minor_id, current_minor); |