lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1604490791-53825-1-git-send-email-dong.menglong@zte.com.cn>
Date:   Wed,  4 Nov 2020 06:53:11 -0500
From:   menglong8.dong@...il.com
To:     davem@...emloft.net
Cc:     kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, dingtianhong@...wei.com,
        Menglong Dong <dong.menglong@....com.cn>
Subject: [PATCH] net: macvlan: remove redundant initialization in macvlan_dev_netpoll_setup

From: Menglong Dong <dong.menglong@....com.cn>

The initialization for err with 0 seems useless, as it is soon updated
with -ENOMEM. So, we can init err with -ENOMEM.

Signed-off-by: Menglong Dong <dong.menglong@....com.cn>
---
 drivers/net/macvlan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index dd96020..a568b39 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1096,10 +1096,9 @@ static int macvlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info
 	struct macvlan_dev *vlan = netdev_priv(dev);
 	struct net_device *real_dev = vlan->lowerdev;
 	struct netpoll *netpoll;
-	int err = 0;
+	int err = -ENOMEM;
 
 	netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL);
-	err = -ENOMEM;
 	if (!netpoll)
 		goto out;
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ