summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdrian Bunk2008-02-21 15:12:06 +0100
committerRoland Dreier2008-02-27 01:24:27 +0100
commited0ba33d64fb933f5fd985aa8f641984efd9d658 (patch)
tree12c45202489de5470f732080aa6ec0be540345a9 /drivers
parentRDMA/nes: Fix off-by-one (diff)
downloadkernel-qcow2-linux-ed0ba33d64fb933f5fd985aa8f641984efd9d658.tar.gz
kernel-qcow2-linux-ed0ba33d64fb933f5fd985aa8f641984efd9d658.tar.xz
kernel-qcow2-linux-ed0ba33d64fb933f5fd985aa8f641984efd9d658.zip
RDMA/nes: Fix a memory leak in schedule_nes_timer()
Fix a memory leak spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c4
1 files changed, 2 insertions, 2 deletions
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;