All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	liuxuenetmail@gmail.com, alex.aring@gmail.com,
	davem@davemloft.net
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
Date: Sat, 21 Sep 2019 13:52:11 +0200	[thread overview]
Message-ID: <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> (raw)
In-Reply-To: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr>

Hello Xue.

On 20.09.19 21:45, Christophe JAILLET wrote:
> Use a 'skb_put_data()' variant instead of rewritting it.
> The __skb_put_data variant is safe here. It is obvious that the skb can
> not overflow. It has just been allocated a few lines above with the same
> 'len'.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/net/ieee802154/mcr20a.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
> index 17f2300e63ee..8dc04e2590b1 100644
> --- a/drivers/net/ieee802154/mcr20a.c
> +++ b/drivers/net/ieee802154/mcr20a.c
> @@ -800,7 +800,7 @@ mcr20a_handle_rx_read_buf_complete(void *context)
>  	if (!skb)
>  		return;
>  
> -	memcpy(skb_put(skb, len), lp->rx_buf, len);
> +	__skb_put_data(skb, lp->rx_buf, len);
>  	ieee802154_rx_irqsafe(lp->hw, skb, lp->rx_lqi[0]);
>  
>  	print_hex_dump_debug("mcr20a rx: ", DUMP_PREFIX_OFFSET, 16, 1,
> 

Could you please review and ACK this? If you are happy I will take it
through my tree.

regards
Stefan Schmidt

WARNING: multiple messages have this Message-ID (diff)
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	liuxuenetmail@gmail.com, alex.aring@gmail.com,
	davem@davemloft.net
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
Date: Sat, 21 Sep 2019 11:52:11 +0000	[thread overview]
Message-ID: <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> (raw)
In-Reply-To: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr>

Hello Xue.

On 20.09.19 21:45, Christophe JAILLET wrote:
> Use a 'skb_put_data()' variant instead of rewritting it.
> The __skb_put_data variant is safe here. It is obvious that the skb can
> not overflow. It has just been allocated a few lines above with the same
> 'len'.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/net/ieee802154/mcr20a.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
> index 17f2300e63ee..8dc04e2590b1 100644
> --- a/drivers/net/ieee802154/mcr20a.c
> +++ b/drivers/net/ieee802154/mcr20a.c
> @@ -800,7 +800,7 @@ mcr20a_handle_rx_read_buf_complete(void *context)
>  	if (!skb)
>  		return;
>  
> -	memcpy(skb_put(skb, len), lp->rx_buf, len);
> +	__skb_put_data(skb, lp->rx_buf, len);
>  	ieee802154_rx_irqsafe(lp->hw, skb, lp->rx_lqi[0]);
>  
>  	print_hex_dump_debug("mcr20a rx: ", DUMP_PREFIX_OFFSET, 16, 1,
> 

Could you please review and ACK this? If you are happy I will take it
through my tree.

regards
Stefan Schmidt

  reply	other threads:[~2019-09-21 11:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 19:45 [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()' Christophe JAILLET
2019-09-20 19:45 ` Christophe JAILLET
2019-09-21 11:52 ` Stefan Schmidt [this message]
2019-09-21 11:52   ` Stefan Schmidt
2019-09-24 21:40   ` Xue Liu
2019-09-24 21:40     ` Xue Liu
2019-09-25  6:25     ` Stefan Schmidt
2019-09-25  6:25       ` Stefan Schmidt

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=388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=liuxuenetmail@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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.