rdma: potential ERR_PTR dereference
PATCH 1/1 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 Dan Carpenter <[email protected]>
net/rds/rdma_transport.c +1 -1
@@ -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,
Quoted 5 lines · Dan Carpenter
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 anERR_PTR. The new code just returns directly.Signed-off-by Dan Carpenter <[email protected]>
Thanks, Dan.
Acked-by Andy Grover <[email protected]>
-- Andy
From: Dan Carpenter <[email protected]>
Date: Thu, 22 Apr 2010 11:55:27 +0200
Quoted 5 lines
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 anERR_PTR. The new code just returns directly.Signed-off-by Dan Carpenter <[email protected]>
Applied.