e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait
authorYueHaibing <yuehaibing@huawei.com>
Mon, 19 Nov 2018 12:48:19 +0000 (20:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:39:55 +0000 (20:39 +0100)
[ Upstream commit cd0d465bb697a9c7bf66a9fe940f7981232f1676 ]

Fix a static code checker warning:
drivers/net/ethernet/intel/e100.c:1349
 e100_load_ucode_wait() warn: passing zero to 'PTR_ERR'

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/e100.c

index 4d10270ddf8fb6e4c0d40e8537eba0f8f534f1bf..90974462743b5c7c0bd1a6a936d711d5c940163b 100644 (file)
@@ -1370,8 +1370,8 @@ static inline int e100_load_ucode_wait(struct nic *nic)
 
        fw = e100_request_firmware(nic);
        /* If it's NULL, then no ucode is required */
-       if (!fw || IS_ERR(fw))
-               return PTR_ERR(fw);
+       if (IS_ERR_OR_NULL(fw))
+               return PTR_ERR_OR_ZERO(fw);
 
        if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
                netif_err(nic, probe, nic->netdev,