Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp53540ybg; Mon, 8 Jun 2020 16:13:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRfyuB0YoELCLbd2yXSVZVQNh1Y1YiYNu+1HUacwRGMhtChlU3ihjSOc0HuPmPqD4nYD6J X-Received: by 2002:a17:906:d043:: with SMTP id bo3mr15176499ejb.409.1591658034008; Mon, 08 Jun 2020 16:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591658034; cv=none; d=google.com; s=arc-20160816; b=IrG5apagVD1Fcz77KVFCg61kB5TWYZEeVHjvbNS3gqiCmzoWfbabrjwaFGqaWZaUCT ICdz1JrwgnVHpgaR5BIxqzdn6At4KitMdg3E+4hq/rJ1wpeEJIFOIiUIk1kwBi1UNQmY NWn5S+Bh444LkGMc1rnsrVt+ng/JTXR/MN9q7x1+gzPz0vFt2oF3k51On6npwmCCgkIl Grm1lhIZJenatCe7h3Fe6m2K+gEyL4k86JR3QGiVt6qPalPQ4W9/U99nYClGsgF9pvZ3 e6O22f/yKGJxJuRs5FLQFESAhEzSrwYqy6UgTtOXinkRKamgOMFJlmIm94S3TNw0qxjH KAbw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BSsthu4tEtm8UuZ9Lm1AK7eG3w10VHTg8+chPk9c3jA=; b=e84sGSiCxdKYH1IpXube+jzwIiMxh9JdAwTfeF8zyzHw59lr1tdAjZarNZCdqXbcab hcXSl3qIh4FRNlG0WqaCRTi8z6DjwQwW7eHUZfwWi3aQKgcnBqKwfQgKW8fD0ONfZ9Ta HTEihwKI5oYCzIAZ6wWLVQy8xGirxwphgRKMGt+WZEVH41zZc4eKtAaUUzN4+ZZwb3yy i6YYmW/0DEuhT6UzLJD/zclLYRyI6905CnnVbjBICSKX1ZIJJlBdZbCmpRC4wuSQpJtK kAHliDpMEanEejgWMFgxdDEKzkanKv/XPq0AG1CkYkFGiNXFozyGRjuAwR50cdRJFRb7 owfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CfgoyIxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si9823766edt.65.2020.06.08.16.13.31; Mon, 08 Jun 2020 16:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CfgoyIxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728813AbgFHXLC (ORCPT + 99 others); Mon, 8 Jun 2020 19:11:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728461AbgFHXJi (ORCPT ); Mon, 8 Jun 2020 19:09:38 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27914208C3; Mon, 8 Jun 2020 23:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657777; bh=JmjN4SKRjIMoEBWFAxnMdHJm535jSOrlTjFMyuVq29s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CfgoyIxlczAim9GGH6xxkFrpqlr+E07pInFm72kRyoMVREEFVkjjBF5BJYoGsZJfq cIyJ33warzhROZdR5ivCUFNd1B4u4yCmkcUOXWmV5uL08OeTuq3s0VN4Jt11vEu7ss 3r4Q1ejw2p8TWZTNfwzRs4K++jPvSh0neZPSDOvo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yunjian Wang , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.7 160/274] net: allwinner: Fix use correct return type for ndo_start_xmit() Date: Mon, 8 Jun 2020 19:04:13 -0400 Message-Id: <20200608230607.3361041-160-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunjian Wang [ Upstream commit 09f6c44aaae0f1bdb8b983d7762676d5018c53bc ] The method ndo_start_xmit() returns a value of type netdev_tx_t. Fix the ndo function to use the correct type. And emac_start_xmit() can leak one skb if 'channel' == 3. Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/allwinner/sun4i-emac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 18d3b4340bd4..b3b8a8010142 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -417,7 +417,7 @@ static void emac_timeout(struct net_device *dev, unsigned int txqueue) /* Hardware start transmission. * Send a packet to media from the upper layer. */ -static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev) +static netdev_tx_t emac_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct emac_board_info *db = netdev_priv(dev); unsigned long channel; @@ -425,7 +425,7 @@ static int emac_start_xmit(struct sk_buff *skb, struct net_device *dev) channel = db->tx_fifo_stat & 3; if (channel == 3) - return 1; + return NETDEV_TX_BUSY; channel = (channel == 1 ? 1 : 0); -- 2.25.1