gluon/patches/lede/0104-ar71xx-ag71xx_ethtool-don-t-return-uninitialized-return-value-on-success.patch
Vincent Wiemann 3b15089249 ar71xx/ag71xx: backport patches
This commit backports patches from OpenWrt's master branch which
increase cache performance, reduce NAPI weight and fix bugs.
2018-07-09 02:06:08 +02:00

24 lines
1023 B
Diff

From: Alexander Couzens <lynxis@fe80.eu>
Date: Sun, 11 Jun 2017 12:51:58 +0200
Subject: ar71xx/ag71xx_ethtool: don't return uninitialized return value on success
ag71xx_ethtool_set_ringparam() will return an uninitialized value on
success.
Found-by: Coverity Scan #1330877
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
index dfcbb54e93a298eee7858d6b26e533e0aeefb00b..f0e102152f269c6604925421de6ca27ccc6bb6ad 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
@@ -86,7 +86,7 @@ static int ag71xx_ethtool_set_ringparam(struct net_device *dev,
struct ag71xx *ag = netdev_priv(dev);
unsigned tx_size;
unsigned rx_size;
- int err;
+ int err = 0;
if (er->rx_mini_pending != 0||
er->rx_jumbo_pending != 0 ||