Call kfree only if required else return from function.

Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Rupesh Gujare <[email protected]>
---
 drivers/staging/ozwpan/ozhcd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 33c0009..585aa79 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -274,12 +274,12 @@ static void oz_free_urb_link(struct oz_urb_link *urbl)
                if (g_link_pool_size < OZ_MAX_LINK_POOL_SIZE) {
                        urbl->link.next = g_link_pool;
                        g_link_pool = &urbl->link;
-                       urbl = 0;
                        g_link_pool_size++;
+                       spin_unlock_irqrestore(&g_link_lock, irq_state);
+                       return;
                }
                spin_unlock_irqrestore(&g_link_lock, irq_state);
-               if (urbl)
-                       kfree(urbl);
+               kfree(urbl);
        }
 }
 
/*------------------------------------------------------------------------------
-- 
1.7.5.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to