]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: ethernet: ti: cpsw: fix error return code in cpsw_probe()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Fri, 13 Nov 2020 06:49:33 +0000 (14:49 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Nov 2020 23:37:28 +0000 (15:37 -0800)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 83a8471ba255 ("net: ethernet: ti: cpsw: refactor probe to group common hw initialization")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1605250173-18438-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/cpsw.c

index fa2d1025cbb2a6d9f03bc65d87f367e7427ffcf0..b0f00b4edd9491b1d0cb37df8a7c6be6818b32ef 100644 (file)
@@ -1634,6 +1634,7 @@ static int cpsw_probe(struct platform_device *pdev)
                                       CPSW_MAX_QUEUES, CPSW_MAX_QUEUES);
        if (!ndev) {
                dev_err(dev, "error allocating net_device\n");
+               ret = -ENOMEM;
                goto clean_cpts;
        }