[V2 PATCH 3/3] staging: ozwpan: Remove redundant null check before kfree in ozhcd.c

Rupesh Gujare
2012-11-21T12:48:28Z

Call kfree only if required else return from function.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
---
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