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-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed0ba33d64fb933f5fd985aa8f641984efd9d658;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 bd5cfeaac203..78e845c94576 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;