mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: rc: lirc_dev: check kobject_set_name() result
@ 2010-11-26 17:06 Vasiliy Kulikov
  2010-12-02  2:45 ` Jarod Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-11-26 17:06 UTC (permalink / raw)
  To: kernel-janitors; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

kobject_set_name() may fail with -ENOMEM, check for it.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: rc: lirc_dev: check kobject_set_name() result
  2010-11-26 17:06 [PATCH] media: rc: lirc_dev: check kobject_set_name() result Vasiliy Kulikov
@ 2010-12-02  2:45 ` Jarod Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jarod Wilson @ 2010-12-02  2:45 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel

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 <segoon@openwall.com>
> ---
> Compile tested only.

Works for me.

Acked-by: Jarod Wilson <jarod@redhat.com>

-- 
Jarod Wilson
jarod@wilsonet.com




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-02  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-26 17:06 [PATCH] media: rc: lirc_dev: check kobject_set_name() result Vasiliy Kulikov
2010-12-02  2:45 ` Jarod Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®