Re: [PATCH] More Driver Core patches for 2.6.10-rc1
From: Greg KH
Date: Thu Nov 04 2004 - 19:51:12 EST
ChangeSet 1.2449.2.8, 2004/11/04 10:57:45-08:00, tj@xxxxxxxxxxx
[PATCH] driver-model: device_add() error path reference counting fix
df_05_device_add_ref_fix.patch
In device_add(), @dev wan't put'd properly when it has zero length
bus_id (error path). Fixed.
Signed-off-by: Tejun Heo <tj@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>
drivers/base/core.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c 2004-11-04 16:30:24 -08:00
+++ b/drivers/base/core.c 2004-11-04 16:30:24 -08:00
@@ -209,12 +209,12 @@
*/
int device_add(struct device *dev)
{
- struct device * parent;
- int error;
+ struct device *parent = NULL;
+ int error = -EINVAL;
dev = get_device(dev);
if (!dev || !strlen(dev->bus_id))
- return -EINVAL;
+ goto Error;
parent = get_device(dev->parent);
-
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/