IB/hfi1: Prevent a NULL dereference
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Jan 2018 20:03:46 +0000 (23:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jan 2018 18:58:12 +0000 (19:58 +0100)
commitb3049d3d0688b1647cba4a129b156a510dbbb0b4
treec9ec5512c970e5f7dcab8e50306edefcd5e93be5
parentf0299a1ceecf3ecec3b6c350a23101bdee009ae4
IB/hfi1: Prevent a NULL dereference

commit 57194fa763bfa1a0908f30d4c77835beaa118fcb upstream.

In the original code, we set "fd->uctxt" to NULL and then dereference it
which will cause an Oops.

Fixes: f2a3bc00a03c ("IB/hfi1: Protect context array set/clear with spinlock")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hfi1/file_ops.c