lkml.org 
[lkml]   [2011]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 36/44] RAW driver: Remove call to kobject_put().
Date
From: Robert P. J. Day <rpjday@crashcourse.ca>

If cdev_add() fails, there is no justification for subsequently
calling kobject_put().

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/char/raw.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 6f9db62..b33e8ea 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -339,7 +339,6 @@ static int __init raw_init(void)
cdev_init(&raw_cdev, &raw_fops);
ret = cdev_add(&raw_cdev, dev, max_raw_minors);
if (ret) {
- kobject_put(&raw_cdev.kobj);
goto error_region;
}

--
1.7.4.2


\
 
 \ /
  Last update: 2011-05-20 02:15    [W:0.226 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site