public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2o: destroy event queue only when drv->event is set
@ 2007-05-20 14:25 Akinobu Mita
  0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2007-05-20 14:25 UTC (permalink / raw)
  To: Markus Lidel; +Cc: linux-kernel

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 <Markus.Lidel@shadowconnect.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-20 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-20 14:25 [PATCH] i2o: destroy event queue only when drv->event is set Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox