kobject_set_name() may fail with -ENOMEM, check for it.
Signed-off-by: Vasiliy Kulikov <[email protected]>
---
Compile tested only.
drivers/media/rc/lirc_dev.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 8418b14..0a2d267 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -178,7 +178,9 @@ static int lirc_cdev_add(struct irctl *ir)
cdev_init(cdev, &lirc_dev_fops);
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);
if (retval)
--
1.7.0.4
On Nov 26, 2010, at 12:06 PM, Vasiliy Kulikov wrote:
> kobject_set_name() may fail with -ENOMEM, check for it.
>
> Signed-off-by: Vasiliy Kulikov <[email protected]>
> ---
> Compile tested only.
Works for me.
Acked-by: Jarod Wilson <[email protected]>
--
Jarod Wilson
[email protected]