[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB7PR04MB46189C38B1747F1C3AC4E58FE6AB0@DB7PR04MB4618.eurprd04.prod.outlook.com>
Date: Tue, 20 Aug 2019 10:12:10 +0000
From: Joakim Zhang <qiangqing.zhang@....com>
To: Sean Nyekjaer <sean@...nix.com>,
Martin Hundebøll <martin@...nix.com>,
Wolfgang Grandegger <wg@...ndegger.com>,
Marc Kleine-Budde <mkl@...gutronix.de>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>
CC: "David S . Miller" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] can: flexcan: free error skb if enqueueing failed
> -----Original Message-----
> From: Sean Nyekjaer <sean@...nix.com>
> Sent: 2019年8月20日 17:50
> To: Martin Hundebøll <martin@...nix.com>; Wolfgang Grandegger
> <wg@...ndegger.com>; Marc Kleine-Budde <mkl@...gutronix.de>;
> linux-can@...r.kernel.org
> Cc: David S . Miller <davem@...emloft.net>; netdev@...r.kernel.org; Joakim
> Zhang <qiangqing.zhang@....com>
> Subject: Re: [PATCH] can: flexcan: free error skb if enqueueing failed
>
> CC'ing Joakim Zhang
Looks good, so add my tag:
Acked-by: Joakim Zhang <qiangqing.zhang@....com>
Best Regards,
Joakim Zhang
> On 15/07/2019 20.53, Martin Hundebøll wrote:
> > If the call to can_rx_offload_queue_sorted() fails, the passed skb
> > isn't consumed, so the caller must do so.
> >
> > Fixes: 30164759db1b ("can: flexcan: make use of rx-offload's
> > irq_offload_fifo")
> > Signed-off-by: Martin Hundebøll <martin@...nix.com>
> > ---
> > drivers/net/can/flexcan.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> > index 1c66fb2ad76b..21f39e805d42 100644
> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c
> > @@ -688,7 +688,8 @@ static void flexcan_irq_bus_err(struct net_device
> *dev, u32 reg_esr)
> > if (tx_errors)
> > dev->stats.tx_errors++;
> >
> > - can_rx_offload_queue_sorted(&priv->offload, skb, timestamp);
> > + if (can_rx_offload_queue_sorted(&priv->offload, skb, timestamp))
> > + kfree_skb(skb);
> > }
> >
> > static void flexcan_irq_state(struct net_device *dev, u32 reg_esr)
> > @@ -732,7 +733,8 @@ static void flexcan_irq_state(struct net_device *dev,
> u32 reg_esr)
> > if (unlikely(new_state == CAN_STATE_BUS_OFF))
> > can_bus_off(dev);
> >
> > - can_rx_offload_queue_sorted(&priv->offload, skb, timestamp);
> > + if (can_rx_offload_queue_sorted(&priv->offload, skb, timestamp))
> > + kfree_skb(skb);
> > }
> >
> > static inline struct flexcan_priv *rx_offload_to_priv(struct
> > can_rx_offload *offload)
> >
Powered by blists - more mailing lists