staging: qlge: fix an error code in probe()
If alloc_etherdev_mq() fails then return -ENOMEM instead of success.
The "err = 0;" triggers an unused assignment now so remove that as
well.
Fixes: 953b940093
("staging: qlge: Initialize devlink health dump framework")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YFiyicHI189PXrha@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ac3d71e0cb
commit
f7bff01774
@ -4549,7 +4549,7 @@ static int qlge_probe(struct pci_dev *pdev,
|
||||
struct net_device *ndev = NULL;
|
||||
struct devlink *devlink;
|
||||
static int cards_found;
|
||||
int err = 0;
|
||||
int err;
|
||||
|
||||
devlink = devlink_alloc(&qlge_devlink_ops, sizeof(struct qlge_adapter));
|
||||
if (!devlink)
|
||||
@ -4560,8 +4560,10 @@ static int qlge_probe(struct pci_dev *pdev,
|
||||
ndev = alloc_etherdev_mq(sizeof(struct qlge_netdev_priv),
|
||||
min(MAX_CPUS,
|
||||
netif_get_num_default_rss_queues()));
|
||||
if (!ndev)
|
||||
if (!ndev) {
|
||||
err = -ENOMEM;
|
||||
goto devlink_free;
|
||||
}
|
||||
|
||||
ndev_priv = netdev_priv(ndev);
|
||||
ndev_priv->qdev = qdev;
|
||||
|
Loading…
Reference in New Issue
Block a user