]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:38:48 +0000 (13:38 +0100)
[ Upstream commit 35f735c665114840dcd3142f41148d07870f51f7 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ti/cpsw.c

index 4c0f9f2aa60cecfc26be6472d9933781624e4dea..5cdbc7e681b1cfdcd0c49764897389903c98cd8d 100644 (file)
@@ -1640,6 +1640,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;
        }