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

From: Rupesh Gujare
Date: Wed Nov 21 2012 - 07:48:16 EST


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


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