From e578e9a1cc8a5983d87126d5877e305d3189f1b9 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Wed, 23 May 2007 13:58:05 -0700 Subject: [PATCH] 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 --- drivers/message/i2o/driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; }; -- 2.39.5