summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorDan Carpenter2017-07-13 09:45:48 +0200
committerDoug Ledford2017-07-20 17:20:49 +0200
commit5c8857b653e71a9850a02837e1268e3198abbd1a (patch)
treedd3479ff4bcc74152fb5ade330fa4e062467fe53 /drivers/infiniband/ulp
parentRDMA/bnxt_re: checking for NULL instead of IS_ERR() (diff)
downloadkernel-qcow2-linux-5c8857b653e71a9850a02837e1268e3198abbd1a.tar.gz
kernel-qcow2-linux-5c8857b653e71a9850a02837e1268e3198abbd1a.tar.xz
kernel-qcow2-linux-5c8857b653e71a9850a02837e1268e3198abbd1a.zip
IB/IPoIB: Fix error code in ipoib_add_port()
We accidentally don't see the error code on some of these error paths. It means we return ERR_PTR(0) which is NULL and it results in a NULL dereference in the caller. This bug dates to pre-git days. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 70dacaf9044e..4ce315c92b48 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2239,6 +2239,7 @@ static struct net_device *ipoib_add_port(const char *format,
goto register_failed;
}
+ result = -ENOMEM;
if (ipoib_cm_add_mode_attr(priv->dev))
goto sysfs_failed;
if (ipoib_add_pkey_attr(priv->dev))