2020-08-26 03:14:33

by Xu Wang

[permalink] [raw]
Subject: [PATCH] ptp: ptp_ines: Remove redundant null check

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

Signed-off-by: Xu Wang <[email protected]>
---
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


2020-08-27 16:40:45

by Richard Cochran

[permalink] [raw]
Subject: Re: [PATCH] ptp: ptp_ines: Remove redundant null check

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 <[email protected]>

Acked-by: Richard Cochran <[email protected]>