]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: Add sanity checks to pnv_pci_get_{gpu|npu}_dev
authorAlistair Popple <alistair@popple.id.au>
Mon, 3 Apr 2017 09:51:43 +0000 (19:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 3 Apr 2017 13:36:00 +0000 (23:36 +1000)
commitb6822df1db1ab220bf868791fa97a6097e70ad6f
tree080556b55fad008b4111755f12a41fbff31f6c5a
parent69e96956a91bc4af5c24d7c494ea7069fc2934b4
powerpc/powernv: Add sanity checks to pnv_pci_get_{gpu|npu}_dev

The pnv_pci_get_{gpu|npu}_dev functions are used to find associations
between nvlink PCIe devices and standard PCIe devices. However they
lacked basic sanity checking which results in NULL pointer
dereferencing if they are incorrect called can be harder to spot than
an explicit WARN_ON.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/npu-dma.c