Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2850450ybj; Mon, 23 Sep 2019 10:25:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIkaTGGOUjz6frX4EdU5VMaaP+vUk72GgMjF0BUB0J27J58QNIDqBW4lR9ZLc/FJbAddu5 X-Received: by 2002:a17:906:5847:: with SMTP id h7mr879083ejs.218.1569259525825; Mon, 23 Sep 2019 10:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569259525; cv=none; d=google.com; s=arc-20160816; b=OoXbzEN7IDT9vD72itiiavPTTZzBkNamHgohV9kqTZQ0OsNtehxEIbVxNtoP+hQdw4 2gVL+g7doFEduEBTM0804WGKcKXZl9k8BXDmJUIvJJVzJnLacnmvevoLj02wah/y+JRz RvdCveIVnUXS9FyMqECLazMNBF0JH6tyANRMbKeyPgHSlDjBo5BnSIKiheMqB7pK7W+x lPNrXkVHCzdUNAJTZJEwfJyr/BzbXFE0t17NBpOdoN108/XEp9UKbvtCcckOYxneCTvs EN1dgG2Mod/FxrH/yuyzN5SGH3h3bspfN/mlMRHVnBMoiY8Y/dHjCSM3TP91RuW+dviI cSUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=K7tDixfO+SIBUKq2xMYz5dF2WF3KxrmvRUlKwugtFEE=; b=JWIG97JMZ2agU7UK3KnIdAQ07CSoANqK4024Pvd/yawUS8AGGE6BpzlykMReT2QRNw 4a7i4dd5ge2NRV2EydPkReaRMrQU5tDqH9AzaIdlZdLjyV2K5vuYqHhSsK9CfXesOjKr Ekk5//4zkByYMdHtlYjbdW3eN/vFAE29R1HB+ROzUDEj4uVQGkDPkDOq21tfwQxphQwv QndYOpZ82sz8xSoIz7yQ6BcBXbHemZGeBQRgjL6UD1KWXxjZ0sjtNexaDrNhaf8RLORW m0lu+wY/ASOt526QyNFQCAQrlhlr7XJQwXdTNhFcjbTxU4gUjt1ud6KjaTQoUj587yMN 4lBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si5335516ejt.206.2019.09.23.10.25.02; Mon, 23 Sep 2019 10:25:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407584AbfIULwx (ORCPT + 99 others); Sat, 21 Sep 2019 07:52:53 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:59247 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405770AbfIULwx (ORCPT ); Sat, 21 Sep 2019 07:52:53 -0400 Received: from localhost.localdomain (unknown [IPv6:2003:e9:d742:d2ca:2f74:a255:7f82:cac1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id 5EE4AC18BE; Sat, 21 Sep 2019 13:52:48 +0200 (CEST) Subject: Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()' To: Christophe JAILLET , 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 References: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr> From: Stefan Schmidt Message-ID: <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> Date: Sat, 21 Sep 2019 13:52:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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