Skip to content

Commit

Permalink
i2o: destroy event queue only when drv->event is set
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed May 24, 2007
1 parent b3762bf commit e578e9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/message/i2o/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit e578e9a

Please sign in to comment.