Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2524746yba; Mon, 15 Apr 2019 13:33:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhc0sz7Dg59VmxnINE0U/ECYZ3SZFFYLXVqtQrCJg5neSyDyiJ5clDlbCR/1kz9q7N1nDj X-Received: by 2002:a17:902:59c5:: with SMTP id d5mr77609521plj.104.1555360428999; Mon, 15 Apr 2019 13:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555360428; cv=none; d=google.com; s=arc-20160816; b=WGPOHSaBJADN9EIFBax0R/S1DQNjsRYTZVJaZSIgVaUDoBghxw5U/AMLcsymdK572D BSVk5XcTxOfT4BM3AvLCllqVNEm6CyP5eGrmb6Kd5Ab30aU2PCLjjxB1xflSznyeq93I HRsq46pkA9h63FF6bMxWrabn3LUitoGtJWIAW7lwTciFLQRyU4kep2joyyN80CwfH714 2f9ZAF8bO23hOx80S/p/RiNbVAm+6QEMUEZKNZaIvQHfZrX/4HVmf47KlEXUC2k3qz49 7rUvRaktDnJgFAW7yhA61SoXPXaCAfWJpqzVHfmnwXidHqVjR12dyVDOFkiKgdEaF0z1 EWgw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oEcLXsjNubYhHPiGK6fXb/XWtD9iOKTO1JT/DaBfKhk=; b=Kc9qB+jCU8W8ZTzkoTfun/G9y7shtoz3KMrshgaF21kGlonCrNtgOyxiwWVUSnEHPI 0zJDjzmqT49rw1p8V710lUDZDRkRqbs4YJZWGvhfGKCJ1DBDr5cDP65AGeP+oJ215ep8 whrKivMluSr7etb464Hiv1f6dPdub1x7MSlumgcVFFQA1VHDJKt44STDS3XMDbUVkuu8 f6TBOl6MacfbCLu+OfxkRRs+RdseBDvXMycKzqm/eYl6ve844j3DIGd2l1krmCAhw3Tn PxLtBQim1KoAH/628pdvr0TmVmi/AdM5v1EYaLOdGRuymvt68YOFpQwGjNNtKAvR/X3H 0fMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Go9zhcKo; 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 d6si17080167pfr.262.2019.04.15.13.33.32; Mon, 15 Apr 2019 13:33:48 -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=@kernel.org header.s=default header.b=Go9zhcKo; 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 S1730220AbfDOTZX (ORCPT + 99 others); Mon, 15 Apr 2019 15:25:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:39362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728676AbfDOTFg (ORCPT ); Mon, 15 Apr 2019 15:05:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EEDBE20880; Mon, 15 Apr 2019 19:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355135; bh=jkeuBbZtAWfTA82nwl/ZM6RQXsKBPB11gvVO6OjH0vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Go9zhcKojPUu3i6FPALfHuEna/feKX03LNsAvrDZPdSoFTDl5u80ClPlgZBhCEtrc JpIhBiannM/MGNQ9YDJTcdTS8oZiNbQrNXtU5+aYxKWL4H+2EZlM659XdJ4ChVkaJO WwQzTJsxqTTm9TBWlzIGzJ9gDvsd2WO1/7mILH+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , John Hurley , Simon Horman , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 026/101] nfp: validate the return code from dev_queue_xmit() Date: Mon, 15 Apr 2019 20:58:24 +0200 Message-Id: <20190415183741.788299852@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c8ba5b91a04e3e2643e48501c114108802f21cda ] dev_queue_xmit() may return error codes as well as netdev_tx_t, and it always consumes the skb. Make sure we always return a correct netdev_tx_t value. Fixes: eadfa4c3be99 ("nfp: add stats and xmit helpers for representors") Signed-off-by: Jakub Kicinski Reviewed-by: John Hurley Reviewed-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index 18a09cdcd9c6..e0d73b385563 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -225,7 +225,7 @@ static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) ret = dev_queue_xmit(skb); nfp_repr_inc_tx_stats(netdev, len, ret); - return ret; + return NETDEV_TX_OK; } static int nfp_repr_stop(struct net_device *netdev) -- 2.19.1