Home
last modified time | relevance | path

Searched hist:bbc780f8 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/base/
H A Dcore.cbbc780f8 Thu Nov 21 13:15:48 CST 2013 David Herrmann <dh.herrmann@gmail.com> driver core: fix device_create() error path

We call put_device() in the error path, which is fine for dev==NULL.
However, in case kobject_set_name_vargs() fails, we have dev!=NULL but
device_initialized() wasn't called, yet.

Fix this by splitting device_register() into explicit calls to
device_add() and an early call to device_initialize().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bbc780f8 Thu Nov 21 13:15:48 CST 2013 David Herrmann <dh.herrmann@gmail.com> driver core: fix device_create() error path

We call put_device() in the error path, which is fine for dev==NULL.
However, in case kobject_set_name_vargs() fails, we have dev!=NULL but
device_initialized() wasn't called, yet.

Fix this by splitting device_register() into explicit calls to
device_add() and an early call to device_initialize().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>