tomh / rpms / lirc

Forked from rpms/lirc 6 years ago
Clone

Blame 0017-media-media-rc-lirc_dev-check-kobject_set_name-resul.patch

Alec Leamas 3462c82
From e0ab92be1fa293b8593a77636b3d025fa2aefb82 Mon Sep 17 00:00:00 2001
Alec Leamas 3462c82
From: Jarod Wilson <jarod@redhat.com>
Alec Leamas 3462c82
Date: Tue, 7 Feb 2012 11:47:31 -0500
Alec Leamas 3462c82
Subject: [PATCH 17/17] [media] media: rc: lirc_dev: check kobject_set_name()
Alec Leamas 3462c82
 result
Alec Leamas 3462c82
Alec Leamas 3462c82
Backport from upstream kernel:
Alec Leamas 3462c82
Alec Leamas 3462c82
commit b395cbac36e58a55729fe7e6262a3f0b1691bced
Alec Leamas 3462c82
Author: Vasiliy Kulikov <segoon@openwall.com>
Alec Leamas 3462c82
Date:   Fri Nov 26 14:06:41 2010 -0300
Alec Leamas 3462c82
Alec Leamas 3462c82
    [media] media: rc: lirc_dev: check kobject_set_name() result
Alec Leamas 3462c82
Alec Leamas 3462c82
    kobject_set_name() may fail with -ENOMEM, check for it.
Alec Leamas 3462c82
Alec Leamas 3462c82
    Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Alec Leamas 3462c82
    Acked-by: Jarod Wilson <jarod@redhat.com>
Alec Leamas 3462c82
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Alec Leamas 3462c82
Alec Leamas 3462c82
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Alec Leamas 3462c82
---
Alec Leamas 3462c82
 drivers/lirc_dev/lirc_dev.c | 4 +++-
Alec Leamas 3462c82
 1 file changed, 3 insertions(+), 1 deletion(-)
Alec Leamas 3462c82
Alec Leamas 3462c82
diff --git a/drivers/lirc_dev/lirc_dev.c b/drivers/lirc_dev/lirc_dev.c
Alec Leamas 3462c82
index 5b25c5f..9d52188 100644
Alec Leamas 3462c82
--- a/drivers/lirc_dev/lirc_dev.c
Alec Leamas 3462c82
+++ b/drivers/lirc_dev/lirc_dev.c
Alec Leamas 3462c82
@@ -236,7 +236,9 @@ static int lirc_cdev_add(struct irctl *ir)
Alec Leamas 3462c82
 		cdev_init(cdev, &lirc_dev_fops);
Alec Leamas 3462c82
 		cdev->owner = THIS_MODULE;
Alec Leamas 3462c82
 	}
Alec Leamas 3462c82
-	kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
Alec Leamas 3462c82
+	retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
Alec Leamas 3462c82
+	if (retval)
Alec Leamas 3462c82
+		return retval;
Alec Leamas 3462c82
 
Alec Leamas 3462c82
 	retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
Alec Leamas 3462c82
 	if (retval)
Alec Leamas 3462c82
-- 
Alec Leamas 3462c82
1.8.3.1
Alec Leamas 3462c82