Commit 95b86e6b authored by Thomas Koeller's avatar Thomas Koeller Committed by Greg Kroah-Hartman

[PATCH] Driver Core: fix minor class reference counting issue on the error path

Signed-off-by: default avatarThomas Koeller <thomas.koeller@baslerweb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent e40ef359
......@@ -349,14 +349,19 @@ void class_device_initialize(struct class_device *class_dev)
int class_device_add(struct class_device *class_dev)
{
struct class * parent;
struct class * parent = NULL;
struct class_interface * class_intf;
int error;
class_dev = class_device_get(class_dev);
if (!class_dev || !strlen(class_dev->class_id))
if (!class_dev)
return -EINVAL;
if (!strlen(class_dev->class_id)) {
error = -EINVAL;
goto register_done;
}
parent = class_get(class_dev->class);
pr_debug("CLASS: registering class device: ID = '%s'\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment