提交 94713bab 编写于 作者: D Dan Carpenter 提交者: David S. Miller

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NAndy Grover <andy.grover@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5d57eeb5
...@@ -224,8 +224,8 @@ static int rds_ib_laddr_check(__be32 addr) ...@@ -224,8 +224,8 @@ static int rds_ib_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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册