Commit 94713bab authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: 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 5d57eeb5
......@@ -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;
......
Supports Markdown
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