Commit 24acc689 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

rdma: potential ERR_PTR dereference

In the original code, the "goto out" calls "rdma_destroy_id(cm_id);"
That isn't needed here and would cause problems because "cm_id" is an
ERR_PTR.  The new code just returns directly.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarAndy Grover <andy.grover@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80032cff
...@@ -134,7 +134,7 @@ static int __init rds_rdma_listen_init(void) ...@@ -134,7 +134,7 @@ static int __init rds_rdma_listen_init(void)
ret = PTR_ERR(cm_id); ret = PTR_ERR(cm_id);
printk(KERN_ERR "RDS/RDMA: failed to setup listener, " printk(KERN_ERR "RDS/RDMA: failed to setup listener, "
"rdma_create_id() returned %d\n", ret); "rdma_create_id() returned %d\n", ret);
goto out; return ret;
} }
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