Commit b395cbac authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Mauro Carvalho Chehab

[media] media: rc: lirc_dev: check kobject_set_name() result

kobject_set_name() may fail with -ENOMEM, check for it.
Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
Acked-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 801c73c0
...@@ -178,7 +178,9 @@ static int lirc_cdev_add(struct irctl *ir) ...@@ -178,7 +178,9 @@ static int lirc_cdev_add(struct irctl *ir)
cdev_init(cdev, &lirc_dev_fops); cdev_init(cdev, &lirc_dev_fops);
cdev->owner = THIS_MODULE; cdev->owner = THIS_MODULE;
} }
kobject_set_name(&cdev->kobj, "lirc%d", d->minor); retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
if (retval)
return retval;
retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1); retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
if (retval) if (retval)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment