From: Dan Carpenter Date: Wed, 21 Apr 2010 23:55:27 +0000 (+0000) Subject: rdma: potential ERR_PTR dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=24acc6895616b373475e92e49925efc3ef591563;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Acked-by: Andy Grover Signed-off-by: David S. Miller --- diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 9ece910ea39..7b155081b4d 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -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,