Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1773341ybn; Thu, 26 Sep 2019 01:55:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjdfqVbRf8GADEV+JbxQ2IK1haRqngjfVVpnIussanPpPApQ+sByVbpRUJ5JWQHwR1vii5 X-Received: by 2002:a50:ab0f:: with SMTP id s15mr2320620edc.119.1569488122776; Thu, 26 Sep 2019 01:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569488122; cv=none; d=google.com; s=arc-20160816; b=gugQRdu222RFrETBY5UyPqwh7euCrkOU+4TEUhSDlssND16e3YRGccnn8FqmSobQoV VPdNLJxCy6lW7RheKPfTPaiGyIzWh0nzHGwMaaOW4zKZdOMR/2wKZ+rCWKlHFoWpy50F nACN+rfu8uFduvDT00OdTOLrE2ORFPk0U9sPVm7s/6WVKiurUDt1qO4sw8ZqlwjtbqT4 1XmTM3VZhtgRZG3EYBURCctK6ge3Rxfbtxop9wCp787CeQKgwDfzDcsKyo3KG3WdlMe6 3K0O0B6lvF6Gf3NKDyD2j+MbBQUFi53w18eUp3fr17qpkvxG2lEsUxKCvqldAc0u0k6e bLdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XLiq4XMb5jpJuPtXafRR0vUQWEgS1Nd2j0UWbBZvLBQ=; b=J0cHcfkCHCikfZj2J7lDyQpoFlzkP20QRpsl09fwdZhOdtkevO+XrsbnLWL0dEaROh fCs7wl5B07o/0nS/MulmdEuemzUhoFLwQzJZLwTrWJgF0AX7wTOSrRepAGKzzcOV1duy WtJhOwKjumaERv2CNrNdZl0Exoa99zGTZve6M6c+2UOGU6bDprGkMN4W4u4pogZ3I+fI eLVdT+RzvakAzypMLthrlTVjFB609KQ5RekXktQh8si7y6gwNw3UhTD6LH6Ts14Pu0Hr W/t23O+xaMW/Qjt7ElQBdcatJlvHgyHA/InGblnB0dHn/fpRlAUKeUTFBEyv0nNdxTXl mQLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="fxctM/Tk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r18si647878ejr.189.2019.09.26.01.54.59; Thu, 26 Sep 2019 01:55:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="fxctM/Tk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388318AbfIXVk6 (ORCPT + 99 others); Tue, 24 Sep 2019 17:40:58 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:35391 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728516AbfIXVk6 (ORCPT ); Tue, 24 Sep 2019 17:40:58 -0400 Received: by mail-lj1-f196.google.com with SMTP id m7so3467021lji.2; Tue, 24 Sep 2019 14:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XLiq4XMb5jpJuPtXafRR0vUQWEgS1Nd2j0UWbBZvLBQ=; b=fxctM/TkIRYaNpPm4/5bKV6Wn4LhKOi+e0tf9ofeZAhiqlT1tWbcZVgFJG9t/04dS0 U8HTWnksBs88olDZHxqdlsjRIdMvllD78Af1RFmpp9/mpFZD8zbcokoBu8U0a+duScW3 KTQbZnW1vPBZTkCKXhbW1HmoBoSDxImowfYtxAdNkCBWKdxY9QGxLfN6wcz/iLS9SLGC +Ls0W5huwikvM+MQ2dMZffO1f510/E1U4wGzRmJr3po40y4OR0SAUgyId8mNbtm91w2i 7ccKYMuYhgT1G1Vpu7QBniO8HjHmDyWJsPfd2iCgpQE+P565TQn25XArhlKpf3eKbb1t 1Ahw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XLiq4XMb5jpJuPtXafRR0vUQWEgS1Nd2j0UWbBZvLBQ=; b=QLtvat6xCjJUyzIFGE+VSPhn+pnq8PKsniVM1Q7L5aABO+xqTbq4NYnOYJvuu53/Zm cEQ2qMp6v9LyeI1FoXbQDmR7vKOmo3DzsDgaz1b6LzsIhT2vuUBD3XxifeIASKvEu/Tc vHyIyIEtqUbeAh9fYMjt1eLUdtO3nkQj1gTlU0VrGBN6TxekWawd5nGBadBiuL292j1L aJc9teCkdKGiVHxmQyOGz7C/Y8xfxS1MuVieb09ESvT9ImmqEhGtSkLcKyFCHT9H7AaQ CM//pM7X7Gq6B233p0lIw+98PddTYBAfkF3Vz8dRnzflQdV3gtZo6AwSVN7JtzAeveOc jRQQ== X-Gm-Message-State: APjAAAV0II/p/CIq8CZLI2SFzk1vp4Zam+yZF0Ft/vdA4FvuZPetopHr +M1Orf5RHV8M455otlskCtofFDDTdxiNgkrd0Wg= X-Received: by 2002:a2e:1409:: with SMTP id u9mr3535129ljd.162.1569361255800; Tue, 24 Sep 2019 14:40:55 -0700 (PDT) MIME-Version: 1.0 References: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr> <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> In-Reply-To: <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> From: Xue Liu Date: Tue, 24 Sep 2019 23:40:21 +0200 Message-ID: Subject: Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()' To: Stefan Schmidt Cc: Christophe JAILLET , "alex. aring" , "David S. Miller" , linux-wpan - ML , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Sep 2019 at 13:52, Stefan Schmidt 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 > > --- > > 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 --