From: Adrian Bunk Date: Thu, 21 Feb 2008 14:12:06 +0000 (-0600) Subject: RDMA/nes: Fix a memory leak in schedule_nes_timer() X-Git-Tag: v2.6.25-rc4~150^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed0ba33d64fb933f5fd985aa8f641984efd9d658;p=platform%2Fkernel%2Flinux-3.10.git RDMA/nes: Fix a memory leak in schedule_nes_timer() Fix a memory leak spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Glenn Streiff Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index bd5cfea..78e845c 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -370,11 +370,11 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, int ret = 0; u32 was_timer_set; + if (!cm_node) + return -EINVAL; new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); if (!new_send) return -1; - if (!cm_node) - return -EINVAL; /* new_send->timetosend = currenttime */ new_send->retrycount = NES_DEFAULT_RETRYS;