i2o: destroy event queue only when drv->event is set
PATCH 1/1 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 <[email protected]>
Signed-off-by Akinobu Mita <[email protected]>
--- drivers/message/i2o/driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/message/i2o/driver.c +6 -2
@@ -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; };