Commit 5d57eeb5 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

ERR_PTR() dereference in net/rds/iw.c

rdma_create_id() returns ERR_PTR() not null.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

regards,
dan carpenter
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05a178ec
...@@ -233,8 +233,8 @@ static int rds_iw_laddr_check(__be32 addr) ...@@ -233,8 +233,8 @@ static int rds_iw_laddr_check(__be32 addr)
* IB and iWARP capable NICs. * IB and iWARP capable NICs.
*/ */
cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP);
if (!cm_id) if (IS_ERR(cm_id))
return -EADDRNOTAVAIL; return PTR_ERR(cm_id);
memset(&sin, 0, sizeof(sin)); memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment