All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH net] net: rswitch: Fix error path in rswitch_start_xmit()
Date: Tue, 21 Nov 2023 11:55:41 +0300	[thread overview]
Message-ID: <7b8197aa-edb8-76ed-57be-6fd8ab247a9c@omp.ru> (raw)
In-Reply-To: <20231121055255.3627949-1-yoshihiro.shimoda.uh@renesas.com>

On 11/21/23 8:52 AM, Yoshihiro Shimoda wrote:

> This .ndo_start_xmit() function should return netdev_tx_t value,
> not -ENOMEM. Also, before returning the function, dev_kfree_skb_any()
> should be called. So, fix them.

   Sounds like 2 separate issues -- each needing a patch of its own...

> Fixes: 33f5d733b589 ("net: renesas: rswitch: Improve TX timestamp accuracy")
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/net/ethernet/renesas/rswitch.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
> index 43a7795d6591..fc9dcf5fa166 100644
> --- a/drivers/net/ethernet/renesas/rswitch.c
> +++ b/drivers/net/ethernet/renesas/rswitch.c
> @@ -1535,7 +1535,8 @@ static netdev_tx_t rswitch_start_xmit(struct sk_buff *skb, struct net_device *nd
>  		ts_info = kzalloc(sizeof(*ts_info), GFP_ATOMIC);
>  		if (!ts_info) {
>  			dma_unmap_single(ndev->dev.parent, dma_addr, skb->len, DMA_TO_DEVICE);
> -			return -ENOMEM;
> +			dev_kfree_skb_any(skb);
> +			return ret;

   Looks like we have the same error path as when dma_mapping_error()
returns error. Shouldn't we use *goto*? Although probably can be done
later, as a cleanup...

[...]

MBR, Sergey

  reply	other threads:[~2023-11-21  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  5:52 [PATCH net] net: rswitch: Fix error path in rswitch_start_xmit() Yoshihiro Shimoda
2023-11-21  8:55 ` Sergey Shtylyov [this message]
2023-11-21 23:41   ` Yoshihiro Shimoda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b8197aa-edb8-76ed-57be-6fd8ab247a9c@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.