]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
IB/hfi1: Prevent a NULL dereference
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Jan 2018 20:03:46 +0000 (23:03 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 10 Jan 2018 21:48:09 +0000 (16:48 -0500)
commit57194fa763bfa1a0908f30d4c77835beaa118fcb
tree5c5adaa5b07c08e423a32d8d1d1f1f270c16b89a
parentcd52cb26e7ead5093635e98e07e221e4df482d34
IB/hfi1: Prevent a NULL dereference

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")
Cc: <stable@vger.kernel.org> # 4.14.x
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>
drivers/infiniband/hw/hfi1/file_ops.c