Skip to content

Commit

Permalink
ERR_PTR() dereference in net/rds/ib.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Apr 10, 2009
1 parent 5d57eeb commit 94713ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/rds/ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 94713ba

Please sign in to comment.