Files
linux/drivers
Thomas Gleixner e6309e7568 Driver-core: Fix bogus 0 error return in device_add()
If device_add() is called with a device which does not have dev->p set
up, then device_private_init() is called. If that succeeds, then the
error variable is set to 0. Now if the dev_name(dev) check further
down fails, then device_add() correctly terminates, but returns 0.
That of course lets the driver progress. If later another driver uses
this half set up device as parent then device_add() of the child
device explodes and renders sysfs completely unusable.

Set the error to -EINVAL if dev_name() check fails.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: "Hans J. Koch" <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-23 11:23:44 -08:00
..
2009-12-22 14:17:56 -08:00
2009-12-15 08:53:34 -08:00
2009-12-12 13:08:15 +01:00
2009-12-15 08:53:25 -08:00
2009-12-02 01:13:11 -08:00
2009-12-22 14:17:56 -08:00
2009-12-15 09:33:36 -08:00
2009-12-22 14:17:56 -08:00
2009-12-09 17:14:38 +11:00
2009-12-22 14:17:56 -08:00
2009-12-22 12:27:33 -05:00
2009-12-15 08:53:25 -08:00