iser-target: Fix non negative ERR_PTR isert_device_get usage
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 6 Jan 2016 18:25:43 +0000 (10:25 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 7 Jan 2016 21:57:51 +0000 (13:57 -0800)
commit373a4cd7378220d3c5a69fd369b1d78fee3207b2
tree5e9905ca689767da95d7e69dd05a67412503a0eb
parent091b70623e2b9caee1c27190c3a5614b3563a672
iser-target: Fix non negative ERR_PTR isert_device_get usage

As reported by Dan, isert_create_device_ib_res() failure within
isert_device_get() can potentially return a postive value,
resulting in ERR_PTR() triggering a NULL pointer dereference.

Caught by the static checker:

     drivers/infiniband/ulp/isert/ib_isert.c:423 isert_device_get()
     error: passing non negative 1 to ERR_PTR

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/infiniband/ulp/isert/ib_isert.c