diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-10-16 22:05:05 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 14:21:01 -0700 |
commit | c552cad06920b6dc20bb0b41bbb37b60f194e46a (patch) | |
tree | 4e67ec0bc12af21ec7fad7175d888815e743819f | |
parent | 0b84283d642d6865e15ddad62dd2f1a092812f5a (diff) |
Driver core: Fix cleanup in device_create_vargs().
commit 286661b3777897220ecfcd774bccc68a34667f39 upstream
If device_register() in device_create_vargs() fails, the device
must be cleaned up with put_device() (which is also fine on NULL)
instead of kfree().
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/base/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index d021c98605b3..94aee9d68a03 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1243,7 +1243,7 @@ struct device *device_create_vargs(struct class *class, struct device *parent, return dev; error: - kfree(dev); + put_device(dev); return ERR_PTR(retval); } EXPORT_SYMBOL_GPL(device_create_vargs); |