Patchwork NFC: remove pointless conditional before kfree_skb()

login
register
mail settings
Submitter Wei Yongjun
Date Aug. 28, 2012, 1:02 p.m.
Message ID <CAPgLHd80nD+uYpMMC+sLjcErRcLbGpAVMw7PktrAoxJB8NwHsg@mail.gmail.com>
Download mbox | patch
Permalink /patch/180476/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - Aug. 28, 2012, 1:02 p.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove pointless conditional before kfree_skb().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/nfc/hci/shdlc.c | 3 +--
 net/nfc/hci/core.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Samuel Ortiz - Sept. 7, 2012, 4:48 p.m.
Hi Wei,

On Tue, Aug 28, 2012 at 09:02:40PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Remove pointless conditional before kfree_skb().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  net/nfc/hci/shdlc.c | 3 +--
>  net/nfc/hci/core.c  | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)
Thanks, patch applied to my nfc-next branch.

Cheers,
Samuel.

Patch

diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c
index 6f840c1..52e5cbb 100644
--- a/net/nfc/hci/shdlc.c
+++ b/net/nfc/hci/shdlc.c
@@ -241,8 +241,7 @@  static void nfc_shdlc_rcv_i_frame(struct nfc_shdlc *shdlc,
 	}
 
 exit:
-	if (skb)
-		kfree_skb(skb);
+	kfree_skb(skb);
 }
 
 static void nfc_shdlc_rcv_ack(struct nfc_shdlc *shdlc, int y_nr)

diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 1ac7b3f..35413cc 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -398,8 +398,7 @@  disconnect_all:
 	nfc_hci_disconnect_all_gates(hdev);
 
 exit:
-	if (skb)
-		kfree_skb(skb);
+	kfree_skb(skb);
 
 	return r;
 }