Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e578e9a1 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

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 <Markus.Lidel@shadowconnect.com>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3762bfc
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -123,8 +123,12 @@ int i2o_driver_register(struct i2o_driver *drv)
	}
	}


	rc = driver_register(&drv->driver);
	rc = driver_register(&drv->driver);
	if (rc)
	if (rc) {
		if (drv->event) {
			destroy_workqueue(drv->event_queue);
			destroy_workqueue(drv->event_queue);
			drv->event_queue = NULL;
		}
	}


	return rc;
	return rc;
};
};