All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: check the return value of kobject_set_name
@ 2014-06-07 13:56 Anton Protopopov
  2014-06-09 10:01 ` Ian Abbott
  0 siblings, 1 reply; 7+ messages in thread
From: Anton Protopopov @ 2014-06-07 13:56 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Anton Protopopov

Added a check of the return value of the kobject_set_name function.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
---
 drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 9d99fb3..dfeefa2 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2597,7 +2597,14 @@ static int __init comedi_init(void)
 		return -EIO;
 	cdev_init(&comedi_cdev, &comedi_fops);
 	comedi_cdev.owner = THIS_MODULE;
-	kobject_set_name(&comedi_cdev.kobj, "comedi");
+
+	retval = kobject_set_name(&comedi_cdev.kobj, "comedi");
+	if (retval) {
+		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
+					 COMEDI_NUM_MINORS);
+		return retval;
+	}
+
 	if (cdev_add(&comedi_cdev, MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS)) {
 		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
 					 COMEDI_NUM_MINORS);
-- 
1.8.3.4


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

* Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-06-07 13:56 [PATCH] Staging: comedi: check the return value of kobject_set_name Anton Protopopov
@ 2014-06-09 10:01 ` Ian Abbott
  2014-07-09  4:24   ` Anton Protopopov
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Abbott @ 2014-06-09 10:01 UTC (permalink / raw)
  To: Anton Protopopov, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-06-07 14:56, Anton Protopopov wrote:
> Added a check of the return value of the kobject_set_name function.
>
> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
> ---
>   drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

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

* Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-06-09 10:01 ` Ian Abbott
@ 2014-07-09  4:24   ` Anton Protopopov
  2014-07-09  4:28     ` gregkh
  0 siblings, 1 reply; 7+ messages in thread
From: Anton Protopopov @ 2014-07-09  4:24 UTC (permalink / raw)
  To: gregkh; +Cc: hsweeten, devel, linux-kernel, abbotti

2014-06-09 14:01 GMT+04:00 Ian Abbott <abbotti@mev.co.uk>:
> On 2014-06-07 14:56, Anton Protopopov wrote:
>>
>> Added a check of the return value of the kobject_set_name function.
>>
>> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
>> ---
>>   drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>
>
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

This patch was lost, I guess?

>
> --
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
> -=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

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

* Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-07-09  4:24   ` Anton Protopopov
@ 2014-07-09  4:28     ` gregkh
  2014-07-09  4:48       ` Anton Protopopov
  0 siblings, 1 reply; 7+ messages in thread
From: gregkh @ 2014-07-09  4:28 UTC (permalink / raw)
  To: Anton Protopopov; +Cc: devel, abbotti, linux-kernel

On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote:
> 2014-06-09 14:01 GMT+04:00 Ian Abbott <abbotti@mev.co.uk>:
> > On 2014-06-07 14:56, Anton Protopopov wrote:
> >>
> >> Added a check of the return value of the kobject_set_name function.
> >>
> >> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
> >> ---
> >>   drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
> >>   1 file changed, 8 insertions(+), 1 deletion(-)
> >
> >
> > Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
> 
> This patch was lost, I guess?

I don't seem to have it anymore in my inbox, please resend.

greg k-h

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

* Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-07-09  4:28     ` gregkh
@ 2014-07-09  4:48       ` Anton Protopopov
  2014-07-09  4:55         ` gregkh
  0 siblings, 1 reply; 7+ messages in thread
From: Anton Protopopov @ 2014-07-09  4:48 UTC (permalink / raw)
  To: gregkh; +Cc: devel, abbotti, linux-kernel



09.07.2014 08:28, gregkh пишет:
> On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote:
>> 2014-06-09 14:01 GMT+04:00 Ian Abbott <abbotti@mev.co.uk>:
>>> On 2014-06-07 14:56, Anton Protopopov wrote:
>>>>
>>>> Added a check of the return value of the kobject_set_name function.
>>>>
>>>> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
>>>> ---
>>>>   drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
>>>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>>
>>>
>>> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
>>
>> This patch was lost, I guess?
> 
> I don't seem to have it anymore in my inbox, please resend.
> 
> greg k-h
> 


Added a check of the return value of the kobject_set_name function.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
---
 drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 9d99fb3..dfeefa2 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2597,7 +2597,14 @@ static int __init comedi_init(void)
 		return -EIO;
 	cdev_init(&comedi_cdev, &comedi_fops);
 	comedi_cdev.owner = THIS_MODULE;
-	kobject_set_name(&comedi_cdev.kobj, "comedi");
+
+	retval = kobject_set_name(&comedi_cdev.kobj, "comedi");
+	if (retval) {
+		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
+					 COMEDI_NUM_MINORS);
+		return retval;
+	}
+
 	if (cdev_add(&comedi_cdev, MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS)) {
 		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
 					 COMEDI_NUM_MINORS);
-- 
1.8.3.4

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

* Re: [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-07-09  4:48       ` Anton Protopopov
@ 2014-07-09  4:55         ` gregkh
  2014-07-09  5:12           ` Anton Protopopov
  0 siblings, 1 reply; 7+ messages in thread
From: gregkh @ 2014-07-09  4:55 UTC (permalink / raw)
  To: Anton Protopopov; +Cc: devel, abbotti, linux-kernel

On Wed, Jul 09, 2014 at 08:48:53AM +0400, Anton Protopopov wrote:
> 
> 
> 09.07.2014 08:28, gregkh пишет:
> > On Wed, Jul 09, 2014 at 08:24:06AM +0400, Anton Protopopov wrote:
> >> 2014-06-09 14:01 GMT+04:00 Ian Abbott <abbotti@mev.co.uk>:
> >>> On 2014-06-07 14:56, Anton Protopopov wrote:
> >>>>
> >>>> Added a check of the return value of the kobject_set_name function.
> >>>>
> >>>> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
> >>>> ---
> >>>>   drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
> >>>>   1 file changed, 8 insertions(+), 1 deletion(-)
> >>>
> >>>
> >>> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
> >>
> >> This patch was lost, I guess?
> > 
> > I don't seem to have it anymore in my inbox, please resend.
> > 
> > greg k-h
> > 
> 
> 
> Added a check of the return value of the kobject_set_name function.
> 
> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
> ---
>  drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Please send in a format I can apply in (i.e. I don't have to edit the
changelog by hand...)

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

* [PATCH] Staging: comedi: check the return value of kobject_set_name
  2014-07-09  4:55         ` gregkh
@ 2014-07-09  5:12           ` Anton Protopopov
  0 siblings, 0 replies; 7+ messages in thread
From: Anton Protopopov @ 2014-07-09  5:12 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Anton Protopopov

Added a check of the return value of the kobject_set_name function.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
---
 drivers/staging/comedi/comedi_fops.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 9d99fb3..dfeefa2 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2597,7 +2597,14 @@ static int __init comedi_init(void)
 		return -EIO;
 	cdev_init(&comedi_cdev, &comedi_fops);
 	comedi_cdev.owner = THIS_MODULE;
-	kobject_set_name(&comedi_cdev.kobj, "comedi");
+
+	retval = kobject_set_name(&comedi_cdev.kobj, "comedi");
+	if (retval) {
+		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
+					 COMEDI_NUM_MINORS);
+		return retval;
+	}
+
 	if (cdev_add(&comedi_cdev, MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS)) {
 		unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
 					 COMEDI_NUM_MINORS);
-- 
1.8.3.4


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

end of thread, other threads:[~2014-07-09  5:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-07 13:56 [PATCH] Staging: comedi: check the return value of kobject_set_name Anton Protopopov
2014-06-09 10:01 ` Ian Abbott
2014-07-09  4:24   ` Anton Protopopov
2014-07-09  4:28     ` gregkh
2014-07-09  4:48       ` Anton Protopopov
2014-07-09  4:55         ` gregkh
2014-07-09  5:12           ` Anton Protopopov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.