Driver core: Fix cleanup in device_create_vargs().
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 3 Sep 2008 16:26:41 +0000 (18:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Oct 2008 16:24:49 +0000 (09:24 -0700)
commit286661b3777897220ecfcd774bccc68a34667f39
treef8f456ee144eab991f1c7569c1f44cb9a220bccc
parent5739411acbaa63a6c22c91e340fdcdbcc7d82a51
Driver core: Fix cleanup in device_create_vargs().

If device_register() in device_create_vargs() fails, the device
must be cleaned up with put_device() (which is also fine on NULL)
instead of kfree().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c