Re: [PATCH] Driver Core patches for 2.6.9-rc1

From: Greg KH
Date: Wed Aug 25 2004 - 18:13:00 EST


ChangeSet 1.1803.64.4, 2004/08/10 14:49:28-07:00, thomas.koeller@xxxxxxxxxxxxx

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

Signed-off-by: Thomas Koeller <thomas.koeller@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/base/class.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)


diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c 2004-08-25 14:56:30 -07:00
+++ b/drivers/base/class.c 2004-08-25 14:56:30 -07:00
@@ -349,13 +349,18 @@

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);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/