]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/eeh: Null check uses of eeh_pe_bus_get
authorRussell Currey <ruscur@russell.cc>
Mon, 12 Sep 2016 04:17:22 +0000 (14:17 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 07:45:21 +0000 (03:45 -0400)
commit99e4d3ddb6782e126a87dfcda48ecd4d1e11cb06
tree1775f26310275f2db269e607eea8ff11e17a0e5c
parent45b2b0cea8e5244e22bfa964625cd6964ef17fec
powerpc/eeh: Null check uses of eeh_pe_bus_get

commit 04fec21c06e35b169a83e75a84a015ab4606bf5e upstream.

eeh_pe_bus_get() can return NULL if a PCI bus isn't found for a given PE.
Some callers don't check this, and can cause a null pointer dereference
under certain circumstances.

Fix this by checking NULL everywhere eeh_pe_bus_get() is called.

Fixes: 8a6b1bc70dbb ("powerpc/eeh: EEH core to handle special event")
Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/eeh_driver.c
arch/powerpc/platforms/powernv/eeh-powernv.c