Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2346563ybj; Mon, 23 Sep 2019 02:09:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB9pDiq1Jd3da6Qx+McK+EJYS9ZUscZO/NgQkp1E9TiN4e32F/Kn1ZlALmvfZn1WRGrhky X-Received: by 2002:a05:6402:1a4f:: with SMTP id bf15mr36487561edb.292.1569229745071; Mon, 23 Sep 2019 02:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569229745; cv=none; d=google.com; s=arc-20160816; b=mNN9aS8gPBJ9mtahGh/gtJ4sa1gtx2l8fgoyT+c2+2YIwOUGenjKNAOrifyA5K5Ru2 kbhuC2OH9nIQot2DRhMu0C80rVLJLZ92KnSqlYUD9fRkNa9GUBZQ7DAQOqq89JStgIxk 7IvinzGWvk8ipKqiZlR5frqPJHfvRl1rrVh6RsuP4uNupHyvVQDywDyTDGKOFwsAi25C kZum4ktWo4jBAVu3KXFEdF+u0A+66wvG7nuqYK116eYksBL5BJKmMTkhvfH3Ry7OSFXB 6a6wAOvTEpWKIzbyafBFiSNTSZDN+7yU0UPY+M/2Vl+uapJ4AQYRWB9OsmLsNyl8jpjB hcMg== 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:mime-version :message-id:date:subject:cc:to:from; bh=ShU0utFirynL477YJfjDOA2hqEI2vftV56SQthNCOoM=; b=WvT0+MluKpvgQ7RfVw12U7uDKwp3nwpCd04SD8Lmmqx7JBrAVnE0hrE6KZuTpXe9zy wqCP2CKPW1jLdyujUtnJiFxPbhmGHXTxVkFTf6baagbQIxHwjg8XB483n61N4LEUZq/E 56opR/1IuGaMtOUbIvVHigY0eVkRuA3jvC53VcAovPWlHvU0IPRUpEbwIADSD1GksFMK KJQS2bqj6D6uywQnm5PRUiTJN/PDQyWgBgvaCV0HU3zAflhDWJuPNtOGYANn8tHs9lHi vLJlmtXifuYD/SduTFsFQDcW9mmB+rkcGJ8NobYMikuW7sXk/tAuUf6gNlZbvBFGiMXG YEVg== 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 y28si5868073edb.162.2019.09.23.02.08.42; Mon, 23 Sep 2019 02:09:05 -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 S1729700AbfITTpm (ORCPT + 99 others); Fri, 20 Sep 2019 15:45:42 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:45992 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727435AbfITTpm (ORCPT ); Fri, 20 Sep 2019 15:45:42 -0400 Received: from localhost.localdomain ([93.22.134.255]) by mwinf5d70 with ME id 3vlc210065Wn77903vlcTj; Fri, 20 Sep 2019 21:45:40 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 20 Sep 2019 21:45:40 +0200 X-ME-IP: 93.22.134.255 From: Christophe JAILLET To: liuxuenetmail@gmail.com, alex.aring@gmail.com, stefan@datenfreihafen.org, davem@davemloft.net Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] ieee802154: mcr20a: simplify a bit 'mcr20a_handle_rx_read_buf_complete()' Date: Fri, 20 Sep 2019 21:45:33 +0200 Message-Id: <20190920194533.5886-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.20.1