Staging: comedi: check the return value of kobject_set_name
PATCH 1/1 Staging: comedi: check the return value of kobject_set_name
Added a check of the return value of the kobject_set_name function.
--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +8 -1
@@ -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 );
Signature · 1 line
1.8.3.4
Quoted 6 lines · Anton Protopopov
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
2014-06-09 14:01 GMT+04:00 Ian Abbott <[email protected]>:
Quoted 11 lines · Anton Protopopov
Quoted 7 lines
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)Reviewed-by Ian Abbott <[email protected]>
This patch was lost, I guess?
Quoted 4 lines
--
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
gregkh
maintainerQuoted 11 lines · Anton Protopopov
2014-06-09 14:01 GMT+04:00 Ian Abbott <[email protected]>:
Quoted 10 lines · Anton Protopopov
Quoted 7 lines
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Quoted 3 lines
Quoted 1 line
Reviewed-by Ian Abbott <[email protected]>This patch was lost, I guess?
I don't seem to have it anymore in my inbox, please resend.
greg k-h
09.07.2014 08:28, gregkh пишет:
Quoted 12 lines · Anton Protopopov
Quoted 11 lines
2014-06-09 14:01 GMT+04:00 Ian Abbott <[email protected]>:
Quoted 10 lines · Anton Protopopov
Quoted 7 lines
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Ian Abbott <[email protected]>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.
--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +8 -1
@@ -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 );
Signature · 1 line
1.8.3.4
gregkh
maintainerQuoted 25 lines · Anton Protopopov
09.07.2014 08:28, gregkh пишет:
Quoted 12 lines · Anton Protopopov
Quoted 11 lines
2014-06-09 14:01 GMT+04:00 Ian Abbott <[email protected]>:
Quoted 10 lines · Anton Protopopov
Quoted 7 lines
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Ian Abbott <[email protected]>This patch was lost, I guess?
I don't seem to have it anymore in my inbox, please resend.
greg k-h
Quoted 6 lines
Added a check of the return value of the
kobject_set_namefunction.Signed-off-by Anton Protopopov <[email protected]>--- 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...)
PATCH 1/1 Staging: comedi: check the return value of kobject_set_name
Added a check of the return value of the kobject_set_name function.
--- drivers/staging/comedi/comedi_fops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +8 -1
@@ -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 );
Signature · 1 line
1.8.3.4