All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
@ 2019-09-20 19:45 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2019-09-20 19:45 UTC (permalink / raw)
  To: liuxuenetmail, alex.aring, stefan, davem
  Cc: linux-wpan, netdev, linux-kernel, kernel-janitors, Christophe JAILLET

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,
-- 
2.20.1


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

* [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
@ 2019-09-20 19:45 ` Christophe JAILLET
  0 siblings, 0 replies; 8+ messages in thread
From: Christophe JAILLET @ 2019-09-20 19:45 UTC (permalink / raw)
  To: liuxuenetmail, alex.aring, stefan, davem
  Cc: linux-wpan, netdev, linux-kernel, kernel-janitors, Christophe JAILLET

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,
-- 
2.20.1

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
  2019-09-20 19:45 ` Christophe JAILLET
@ 2019-09-21 11:52   ` Stefan Schmidt
  -1 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2019-09-21 11:52 UTC (permalink / raw)
  To: Christophe JAILLET, liuxuenetmail, alex.aring, davem
  Cc: linux-wpan, netdev, linux-kernel, kernel-janitors

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

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
@ 2019-09-21 11:52   ` Stefan Schmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2019-09-21 11:52 UTC (permalink / raw)
  To: Christophe JAILLET, liuxuenetmail, alex.aring, davem
  Cc: linux-wpan, netdev, linux-kernel, kernel-janitors

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

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
  2019-09-21 11:52   ` Stefan Schmidt
@ 2019-09-24 21:40     ` Xue Liu
  -1 siblings, 0 replies; 8+ messages in thread
From: Xue Liu @ 2019-09-24 21:40 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Christophe JAILLET, alex. aring, David S. Miller,
	linux-wpan - ML, netdev, linux-kernel, kernel-janitors

On Sat, 21 Sep 2019 at 13:52, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>
> 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

Acked-by: Xue Liu <liuxuenetmail@gmail.com>

--

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
@ 2019-09-24 21:40     ` Xue Liu
  0 siblings, 0 replies; 8+ messages in thread
From: Xue Liu @ 2019-09-24 21:40 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Christophe JAILLET, alex. aring, David S. Miller,
	linux-wpan - ML, netdev, linux-kernel, kernel-janitors

On Sat, 21 Sep 2019 at 13:52, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>
> 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

Acked-by: Xue Liu <liuxuenetmail@gmail.com>

--

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
  2019-09-24 21:40     ` Xue Liu
@ 2019-09-25  6:25       ` Stefan Schmidt
  -1 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2019-09-25  6:25 UTC (permalink / raw)
  To: Xue Liu
  Cc: Christophe JAILLET, alex. aring, David S. Miller,
	linux-wpan - ML, netdev, linux-kernel, kernel-janitors

Hello.

On 24.09.19 23:40, Xue Liu wrote:
> On Sat, 21 Sep 2019 at 13:52, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>>
>> 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
> 
> Acked-by: Xue Liu <liuxuenetmail@gmail.com>


This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()'
@ 2019-09-25  6:25       ` Stefan Schmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2019-09-25  6:25 UTC (permalink / raw)
  To: Xue Liu
  Cc: Christophe JAILLET, alex. aring, David S. Miller,
	linux-wpan - ML, netdev, linux-kernel, kernel-janitors

Hello.

On 24.09.19 23:40, Xue Liu wrote:
> On Sat, 21 Sep 2019 at 13:52, Stefan Schmidt <stefan@datenfreihafen.org> wrote:
>>
>> 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
> 
> Acked-by: Xue Liu <liuxuenetmail@gmail.com>


This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

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

end of thread, other threads:[~2019-09-25  6:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.