summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter2009-04-09 16:09:46 +0200
committerDavid S. Miller2009-04-10 02:21:22 +0200
commit94713bab649736177a1c33a39b7bb33cbd5af3a5 (patch)
treece5bb57051bd5d798308120b540985188c5e5498 /net
parentERR_PTR() dereference in net/rds/iw.c (diff)
downloadkernel-qcow2-linux-94713bab649736177a1c33a39b7bb33cbd5af3a5.tar.gz
kernel-qcow2-linux-94713bab649736177a1c33a39b7bb33cbd5af3a5.tar.xz
kernel-qcow2-linux-94713bab649736177a1c33a39b7bb33cbd5af3a5.zip
ERR_PTR() dereference in net/rds/ib.c
rdma_create_id() doesn't return NULL, only ERR_PTR(). Found by smatch (http://repo.or.cz/w/smatch.git). Compile tested. regards, dan carpenter Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Andy Grover <andy.grover@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/rds/ib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c
index 4933b380985e..b9bcd32431e1 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -224,8 +224,8 @@ static int rds_ib_laddr_check(__be32 addr)
* IB and iWARP capable NICs.
*/
cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
- if (!cm_id)
- return -EADDRNOTAVAIL;
+ if (IS_ERR(cm_id))
+ return PTR_ERR(cm_id);
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;