commit | bbc780f8bab52fef1784151d3c4982cb1143edd2 | [log] [tgz] |
---|---|---|
author | David Herrmann <dh.herrmann@gmail.com> | Thu Nov 21 20:15:48 2013 +0100 |
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | Sun Dec 08 18:25:10 2013 -0800 |
tree | 01585734243405412fbfb466e0eb6919437c4746 | |
parent | d0f80f9aadf60adc4caafed0d2b01e79a315ff80 [diff] |
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>