raw/ioat: fix dereference before null check
authorKevin Laatz <kevin.laatz@intel.com>
Wed, 14 Oct 2020 10:11:10 +0000 (11:11 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 19 Oct 2020 07:57:16 +0000 (09:57 +0200)
commitb6ab5bbd73daad104dbec791f0fb5b7b046b9141
tree4781ffd55abae417d1037093b3406d7f2277f312
parente30b2833c47c79e0b5fae1de31ae07975f440282
raw/ioat: fix dereference before null check

The 'idxd' pointer in 'idxd_rawdev_destroy()' is being dereferenced before
it is checked. To fix this, the null pointer check was moved to occur
earlier in the code.

Coverity issue: 363040
Fixes: ff06fa2cf3ba ("raw/ioat: probe idxd PCI")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
drivers/raw/ioat/idxd_pci.c