Skip to content

Commit

Permalink
rdma: potential ERR_PTR dereference
Browse files Browse the repository at this point in the history
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: Dan Carpenter <[email protected]>
Acked-by: Andy Grover <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
error27 authored and davem330 committed Apr 22, 2010
1 parent 80032cf commit 24acc68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rds/rdma_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int __init rds_rdma_listen_init(void)
ret = PTR_ERR(cm_id);
printk(KERN_ERR "RDS/RDMA: failed to setup listener, "
"rdma_create_id() returned %d\n", ret);
goto out;
return ret;
}

sin.sin_family = AF_INET,
Expand Down

0 comments on commit 24acc68

Please sign in to comment.