From: Akinobu Mita Date: Wed, 23 May 2007 20:58:05 +0000 (-0700) Subject: i2o: destroy event queue only when drv->event is set X-Git-Tag: v2.6.22-rc3~41 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e578e9a1cc8a5983d87126d5877e305d3189f1b9;p=linux-2.6 i2o: destroy event queue only when drv->event is set 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 Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index d3235f213c..d330e4eb86 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c @@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_driver *drv) } 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; };