]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: auxiliary bus: Fix auxiliary bus shutdown null auxdrv ptr
authorDave Jiang <dave.jiang@intel.com>
Fri, 4 Dec 2020 16:46:49 +0000 (09:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Dec 2020 15:47:42 +0000 (16:47 +0100)
commitd6ea3b4093f8f24f9488c85b59de9b24f89f07a2
tree70ccaeb9e6c38981c8d2089ded1f91bc5fd2d6d1
parent5b387b7366827381fbdde0b8c7ecfc7fd6e7e6ee
driver core: auxiliary bus: Fix auxiliary bus shutdown null auxdrv ptr

If the probe of the auxdrv failed, the device->driver is set to NULL.
During kernel shutdown, the bus shutdown will call auxdrv->shutdown and
cause an invalid ptr dereference. Add check to make sure device->driver is
not NULL before we proceed.

Fixes: 6be6ae5a2188 ("Add auxiliary bus support")
Cc: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/160710040926.1889434.8840329810698403478.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/auxiliary.c