lkml.org 
[lkml]   [2002]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.5.44 device_add double up() of device_sem
I noticed this while tracking down an oops.  If there's any sort of
error in device_add(), register_done is jumped to. At that point,
device_sem is up()'d twice. This patch fixes that.


--
It's not denial. I'm just selective about the reality I accept.
-- Bill Watterson
--- a/drivers/base/core.c 2002-10-19 02:45:26.000000000 -0400
+++ b/drivers/base/core.c 2002-10-19 03:07:35.000000000 -0400
@@ -59,7 +59,7 @@
devclass_add_device(dev);
register_done:
if (error) {
- up(&device_sem);
+ down(&device_sem);
list_del_init(&dev->g_list);
list_del_init(&dev->node);
up(&device_sem);
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.024 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site