Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1792625ybn; Thu, 26 Sep 2019 02:14:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqykls7oToGjXKN77KtF1xhvImpw8iv0Lph3uEwxLR0wPjmTOJDGQrqJsSO3kpEcKQo/GPL9 X-Received: by 2002:a17:906:bcd6:: with SMTP id lw22mr2102400ejb.270.1569489296526; Thu, 26 Sep 2019 02:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569489296; cv=none; d=google.com; s=arc-20160816; b=OoB7TcTza4UqVub6ZaQ483Scn7lrlwr1j49MDsyP0xQT4wopm4aVbIgjTqZj48elrn 25mWiW6R6UDDbGOAFMOXWBTcO0eA6qkQz2596Ie38G1FSdNr3g9rCur9X65sJ2kZlq53 NpFDRhTmUXK8V2wQ8jmlS0voSDQg6wRUmiPxew+eD04S+hZZkvxUPr5UpicrHf5sOKEy fln+UrkmfKn1CAz6MGmaTeeJOrVIZjw73vF3myXylrQZzeE2qj+X7vpApIHOWSbxANo4 GSffVl1nuCcFPvwEdxXIJ5EqyuVT/6huM0SN9/70fiy18istd54lhw5g0vRMVLJBr8Km cMVA== 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=k66kdAR6zWQk9vDnkP7FO7dl9zXNJgo8bMDYjOMxE9o=; b=sT+2G834+JF52DZw/PJb6JtixYV6VJzOiQN88ZP+5j3D5qVXDjPBzUVRKEHtyd9uin MezwnhAvp3O3dr2n5ne89L4r5C6OwjflVr/j7SyFgiPhNIz/fqbgY4iJSU9h4QEYcdbJ Mk5J1YxcJDYAOkmCYia28tiQUUfbbFPXi+jqaOR8YZ+a1zhIKu1deTYtrkM0Z90W6ZmV 1VwiGljiPgykUO3O7PEyc8+kbnTV3KQ290+KUzpvyGLbhXIvGMQFl/vQyqXFDL3QIzEs KKEqUtVri0wsp88HWyyEdU9wEbAfTHbPK4ipuns8aTQ5M2ZtZ8SxfqpOMe0Ku0vAwcnw VuoQ== 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 p15si976479eda.294.2019.09.26.02.14.32; Thu, 26 Sep 2019 02:14:56 -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 S2411887AbfIYGZi (ORCPT + 99 others); Wed, 25 Sep 2019 02:25:38 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:47358 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404570AbfIYGZi (ORCPT ); Wed, 25 Sep 2019 02:25:38 -0400 Received: from localhost.localdomain (p200300E9D742D21B26FCBF88D1F65952.dip0.t-ipconnect.de [IPv6:2003:e9:d742:d21b:26fc:bf88:d1f6:5952]) (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 4C630C1B1A; Wed, 25 Sep 2019 08:25:35 +0200 (CEST) Subject: Re: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()' To: Xue Liu 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 References: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr> <388f335a-a9ae-7230-1713-a1ecb682fecf@datenfreihafen.org> From: Stefan Schmidt Message-ID: <7d131e76-d487-ead3-1780-6a9a7d7877a4@datenfreihafen.org> Date: Wed, 25 Sep 2019 08:25:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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. On 24.09.19 23:40, Xue Liu wrote: > 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 This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks! regards Stefan Schmidt