Re: [PATCH] driver core: move uevent call to driver_register

From: Ming Lei
Date: Mon Jul 16 2012 - 21:35:00 EST


On Tue, Jul 3, 2012 at 1:08 AM, Sebastian Ott <sebott@xxxxxxxxxxxxxxxxxx> wrote:

> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -187,6 +187,9 @@ int driver_register(struct device_driver
> ret = driver_add_groups(drv, drv->groups);
> if (ret)
> bus_remove_driver(drv);
> +
> + kobject_uevent(&drv->p->kobj, KOBJ_ADD);

You should just send the uevent if 'ret' equals to zero., otherwise
OOPS may be triggered by kobject_uevent() after the 'drv' has been
removed.


Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/