isa: Prevent NULL dereference in isa_bus driver callbacks
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Wed, 8 Nov 2017 15:23:11 +0000 (10:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:28:11 +0000 (09:28 +0100)
commit1db069c057a1a35adde371547be223f4af6458eb
tree3636e944d892be67d8c605cc12d86b0e57c141ad
parent3aa6d7f8542e1c78bd0072dc4a668cb476360e56
isa: Prevent NULL dereference in isa_bus driver callbacks

commit 5a244727f428a06634f22bb890e78024ab0c89f3 upstream.

The isa_driver structure for an isa_bus device is stored in the device
platform_data member of the respective device structure. This
platform_data member may be reset to NULL if isa_driver match callback
for the device fails, indicating a device unsupported by the ISA driver.

This patch fixes a possible NULL pointer dereference if one of the
isa_driver callbacks to attempted for an unsupported device. This error
should not occur in practice since ISA devices are typically manually
configured and loaded by the users, but we may as well prevent this
error from popping up for the 0day testers.

Fixes: a5117ba7da37 ("[PATCH] Driver model: add ISA bus")
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/isa.c