From patchwork Thu Feb 11 12:12:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 381572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3981AC433E0 for ; Thu, 11 Feb 2021 12:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2CAC64D5D for ; Thu, 11 Feb 2021 12:20:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbhBKMUf (ORCPT ); Thu, 11 Feb 2021 07:20:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbhBKMPy (ORCPT ); Thu, 11 Feb 2021 07:15:54 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D61C061797; Thu, 11 Feb 2021 04:13:24 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id u25so7782545lfc.2; Thu, 11 Feb 2021 04:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5jBv6+wQs+1iSUDgV0nyq65E1gECWYEx7EKoseRNJ2A=; b=OGZ9PZmeIdhle3+Scn8/ejoghrCCylgUFhZMLAx7vpg+WuGICL44nd+DhkL0+aIKO+ K0F4uVm1U7owS7S0qXtx7pxL/PfE67JX/59gWXJQNoSYyh9hPtMgoi/s4gt9DPXoMlO4 gYCbY4ZIw3EGAhyyuYkeWzcf9WQPUH/JYd/sqeKGx9BoqqU9ccllRFwOkldN5gCyFMuQ P0Qb5R1/E+X5gOvC30hePo9xyEBAuxcjzz7/o3EwxgBkXVZMJa3Q4paUU91tXRPDDkPa J0DvfM/ebVwP2IXy+irR2SXwSOb070+wdxVbuMRfGozAdUdn1jDNYvN/VWauh5MDm9w9 ck3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5jBv6+wQs+1iSUDgV0nyq65E1gECWYEx7EKoseRNJ2A=; b=GxiYZUsTSRxbZQcwo4vHpnn5S9YQc/p9R66XHChLBXglTgmt6OA9QxRcHjyt6Mf9+t 7SSwBjR2BiUkFYqaGOGUvrBPWb4hThv/GwFer3o7K6uHLutsgkYaqknKT6N2l/Wez8SL BiLifSqGfE8lthcPEzf5TPacisSUbbppu978rfVdBhRxvPNuYs6FNp1xAN5XK4DALXdW wPzHwxPuXkGO3KRAhaMoXkRuID5oreC+cCrAaEC+FVxYKjezWcvMLWdRpq/PxQDZg8sg YSmboHazHQC7UPg6YkkZaXzLyGXS7WZOsjs9BDG9VZGD9QWCeiCn89YFruKLR9vIKOgV cQ3A== X-Gm-Message-State: AOAM530GcdRRgj6Em9BrqmRmDok4LUJWw1JyP4ozuAeMvxpfZyu0NSjG r3uuwJUAgl/kXU4L65cpqAo= X-Google-Smtp-Source: ABdhPJxife9Z3qnRWVO1rxqnUiFfTeksjfM3MpVJI0k0/pPPCsCB4dxO12N7CiNdPyrCwmPk66b9+g== X-Received: by 2002:a19:4013:: with SMTP id n19mr4156077lfa.543.1613045603088; Thu, 11 Feb 2021 04:13:23 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id f23sm834783ljn.131.2021.02.11.04.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 04:13:22 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: "David S . Miller" , Jakub Kicinski , Rob Herring Cc: Florian Fainelli , Randy Dunlap , Masahiro Yamada , netdev@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Andrew Lunn , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH net-next 5.12 7/8] net: broadcom: bcm4908_enet: fix received skb length Date: Thu, 11 Feb 2021 13:12:38 +0100 Message-Id: <20210211121239.728-8-zajec5@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210211121239.728-1-zajec5@gmail.com> References: <20210209230130.4690-2-zajec5@gmail.com> <20210211121239.728-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rafał Miłecki Use ETH_FCS_LEN instead of magic value and drop incorrect + 2 Signed-off-by: Rafał Miłecki --- drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c index 47c1b7d827c5..2e825db3b2f1 100644 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c @@ -567,7 +567,7 @@ static int bcm4908_enet_poll(struct napi_struct *napi, int weight) dma_unmap_single(dev, slot.dma_addr, slot.len, DMA_FROM_DEVICE); - skb_put(slot.skb, len - 4 + 2); + skb_put(slot.skb, len - ETH_FCS_LEN); slot.skb->protocol = eth_type_trans(slot.skb, enet->netdev); netif_receive_skb(slot.skb);