Call kfree only if required else return from function. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> Signed-off-by: Rupesh Gujare <rgujare@xxxxxxxxxxxxxxx> --- 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 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel