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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/ozpd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 0b3648c..1dd8980 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -399,11 +399,11 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f)
 		f->link.next = pd->tx_pool;
 		pd->tx_pool = &f->link;
 		pd->tx_pool_count++;
-		f = 0;
+		spin_unlock_bh(&pd->tx_frame_lock);
+		return;
 	}
 	spin_unlock_bh(&pd->tx_frame_lock);
-	if (f)
-		kfree(f);
+	kfree(f);
 }
 /*------------------------------------------------------------------------------
  * Context: softirq-serialized
-- 
1.7.5.4


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux