]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
RDMA/nes: Fix a memory leak in schedule_nes_timer()
authorAdrian Bunk <bunk@kernel.org>
Thu, 21 Feb 2008 14:12:06 +0000 (08:12 -0600)
committerRoland Dreier <rolandd@cisco.com>
Wed, 27 Feb 2008 00:24:27 +0000 (16:24 -0800)
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>
drivers/infiniband/hw/nes/nes_cm.c

index bd5cfeaac203df2da0f09ea63ff2fc5e5c9b0c0f..78e845c945761d4dc3d590d51d1a0607e48fef3d 100644 (file)
@@ -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;