Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2458424yba; Mon, 15 Apr 2019 12:04:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwU+kN2nvN3s640+h3CMOLrOUK90Ir30tC0XUJjdqb3p3tz1qWQcu0CcVxc3D8cqXcuooFY X-Received: by 2002:a65:47c6:: with SMTP id f6mr71484201pgs.173.1555355089248; Mon, 15 Apr 2019 12:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355089; cv=none; d=google.com; s=arc-20160816; b=W6+eTNxpzXhbFb7OuEUQGkXORB+FM3Ldadtj0LlRQFo5BQJSpLwADcV8ffSCVtxEtu jYQNrxALv6eV0UTKMfJVNT/xyM2sYWzt5bKO8jKeSA0kpAuQGPT9KFxVG6pVWDUXQXGs 8XSSXvXfZPxFG2HS5ycJ3FQvO1bwKBHTkIcuY4Cm+Az1S/OFfrq7kO8u9Gh0xn8Xl//G TGQObQRtM492GqbefTpqsv31qbrNp4VPNnlSflzuccFFKDoJTA+Mk0ghFgbXEF5EdQKu pe8hJughjaf20tJG2p5GVXDIqOOIossGOvUeMnTftKcTo2v5dK4foIi1biqOK//p+0Hp pFww== 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=uigm9V9WRylYhGRsOOzTl1BXgjq3tKgSSr9J1lDWaNI=; b=XOlUJxi1s40H3310aMUuius4jZfc857u8FLG/xtygx9KD/ct4beKBDMTUmV08E3dxZ WvBrwkmaEYRfYjJ59lNuY5bqPhTeRSgrFSHPSAK9hPJEdlwG99UXOh2wsAYCsvNpaJDK YlvaGG0bJ1kaZmDk9jJYZS2CuYfC8UcLqGBiFYMHhG7TbiQjYZFvm+HGYd90eSa+bwrP Cd0L+KIlwUWqrtpG+IRE3r0TOzgFxexSSFdcP1A3igmM6foyQCwhZ1ADmx2lNOLjBrPo mn1Wk4GLqU9FjO3gXuKPGdRaH8DgEh4HoGafBrd8dV2Rq/xdpNDOdwUqA4sWDCFI0GpD BPXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aekCGlGF; 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 33si47649919plk.421.2019.04.15.12.04.33; Mon, 15 Apr 2019 12:04:49 -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=aekCGlGF; 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 S1729208AbfDOTDW (ORCPT + 99 others); Mon, 15 Apr 2019 15:03:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:35158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728220AbfDOTDV (ORCPT ); Mon, 15 Apr 2019 15:03:21 -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 761AF20880; Mon, 15 Apr 2019 19:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355000; bh=9kB2UqVNkZ1GL3DOYo+QbBILVKKZvFBQybL6Dsc+gPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aekCGlGFGS+z6NT161g8QcqnMZfOuwIKYOiVNrwJQpXGWrO3squbfhrPTwMHgjnfz ER7OwEP5vYhij3Sq7Pfof4l/xjG5gvfXaijt2t1wxxMr0Hxzov4T4FbWmIc/t+Ovqg JqjectZ892/42wR23lVL1UzEyVz/JLrWcwpa3BgU= 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" Subject: [PATCH 4.14 30/69] nfp: validate the return code from dev_queue_xmit() Date: Mon, 15 Apr 2019 20:58:48 +0200 Message-Id: <20190415183731.498737115@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183726.036654568@linuxfoundation.org> References: <20190415183726.036654568@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 From: Jakub Kicinski [ 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: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -200,7 +200,7 @@ static netdev_tx_t nfp_repr_xmit(struct 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)