lkml.org 
[lkml]   [2004]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2.6.10-rc1 5/5] 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@home-tj.org>


Index: linux-export/drivers/base/core.c
===================================================================
--- linux-export.orig/drivers/base/core.c 2004-11-04 10:25:58.000000000 +0900
+++ linux-export/drivers/base/core.c 2004-11-04 11:04:14.000000000 +0900
@@ -209,12 +209,13 @@ void device_initialize(struct device *de
*/
int device_add(struct device *dev)
{
- struct device * parent;
+ struct device * parent = NULL;
int error;

+ 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.101 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site