Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ptp: ptp_ines: Remove redundant null check
@ 2020-08-26  3:12 Xu Wang
  2020-08-27 16:39 ` Richard Cochran
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-08-26  3:12 UTC (permalink / raw)
  To: richardcochran; +Cc: netdev, linux-kernel

Because kfree_skb already checked NULL skb parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 drivers/ptp/ptp_ines.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index 7711651ff19e..2c1fb99aa37c 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -663,8 +663,7 @@ static void ines_txtstamp(struct mii_timestamper *mii_ts,
 
 	spin_unlock_irqrestore(&port->lock, flags);
 
-	if (old_skb)
-		kfree_skb(old_skb);
+	kfree_skb(old_skb);
 
 	schedule_delayed_work(&port->ts_work, 1);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ptp: ptp_ines: Remove redundant null check
  2020-08-26  3:12 [PATCH] ptp: ptp_ines: Remove redundant null check Xu Wang
@ 2020-08-27 16:39 ` Richard Cochran
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Cochran @ 2020-08-27 16:39 UTC (permalink / raw)
  To: Xu Wang; +Cc: netdev, linux-kernel

On Wed, Aug 26, 2020 at 03:12:51AM +0000, Xu Wang wrote:
> Because kfree_skb already checked NULL skb parameter,
> so the additional check is unnecessary, just remove it.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-27 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26  3:12 [PATCH] ptp: ptp_ines: Remove redundant null check Xu Wang
2020-08-27 16:39 ` Richard Cochran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).