Driver core: fix race in dev_driver_string
commitfa8e26457e28606446f9afd6566cead9d0418b73
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 4 Dec 2009 16:06:57 +0000 (4 11:06 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:04:17 +0000 (18 14:04 -0800)
treec42582b761ee36568b11f1415c1d30331c1ae496
parent9f2813ec1f4868d07d8a16f4a9c4932819fc5d8e
Driver core: fix race in dev_driver_string

commit 3589972e51fac1e02d0aaa576fa47f568cb94d40 upstream.

This patch (as1310) works around a race in dev_driver_string().  If
the device is unbound while the function is running, dev->driver might
become NULL after we test it and before we dereference it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c