[PATCH] i2o: destroy event queue only when drv->event is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i2o_driver_register() initalizes event queue for driver
only when drv->event is set. So similarly the event queue
should be destroyed only when drv->event is set in the error path.
Otherwise destroy_workqueue() will called with NULL.

Cc: Markus Lidel <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>

---
 drivers/message/i2o/driver.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: 2.6-mm/drivers/message/i2o/driver.c
===================================================================
--- 2.6-mm.orig/drivers/message/i2o/driver.c
+++ 2.6-mm/drivers/message/i2o/driver.c
@@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_drive
 	}
 
 	rc = driver_register(&drv->driver);
-	if (rc)
-		destroy_workqueue(drv->event_queue);
+	if (rc) {
+		if (drv->event) {
+			destroy_workqueue(drv->event_queue);
+			drv->event_queue = NULL;
+		}
+	}
 
 	return rc;
 };
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux