]> git.baikalelectronics.ru Git - kernel.git/commit
devres: WARN() and return, don't crash on device_del() of uninitialized device
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 10 Jun 2009 19:43:02 +0000 (12:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 12 Jul 2009 20:02:09 +0000 (13:02 -0700)
commit15ad25355a2d4e82a7023d58fbd32f62d4146536
treefe47cc2d57f7a7e2ba7936b7a89bbd49caf5bb5c
parent1dd7ed43f9ed1a40ba409496c4b60ccd7f021eb4
devres: WARN() and return, don't crash on device_del() of uninitialized device

I just debugged an obscure crash caused by a device_del() of a all NULL'd
out struct device (in usb-serial) and found that a patch like this one would
have saved me time (in addition to improved chances of a bug report from
users hitting similar driver bugs).

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/devres.c