Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: ti: j721e-wiz: Fix some error return code in wiz_probe()

Fix to return negative error code from some error handling
cases instead of 0, as done elsewhere in this function.

Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Roger Quadros <rogerq@ti.com>
Link: https://lore.kernel.org/r/20200507054109.110849-1-weiyongjun1@huawei.com
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Wei Yongjun and committed by
Kishon Vijay Abraham I
e2ae8bca 6d9c1de8

+5 -1
+5 -1
drivers/phy/ti/phy-j721e-wiz.c
··· 841 841 } 842 842 843 843 base = devm_ioremap(dev, res.start, resource_size(&res)); 844 - if (!base) 844 + if (!base) { 845 + ret = -ENOMEM; 845 846 goto err_addr_to_resource; 847 + } 846 848 847 849 regmap = devm_regmap_init_mmio(dev, base, &wiz_regmap_config); 848 850 if (IS_ERR(regmap)) { ··· 861 859 862 860 if (num_lanes > WIZ_MAX_LANES) { 863 861 dev_err(dev, "Cannot support %d lanes\n", num_lanes); 862 + ret = -ENODEV; 864 863 goto err_addr_to_resource; 865 864 } 866 865 ··· 951 948 serdes_pdev = of_platform_device_create(child_node, NULL, dev); 952 949 if (!serdes_pdev) { 953 950 dev_WARN(dev, "Unable to create SERDES platform device\n"); 951 + ret = -ENOMEM; 954 952 goto err_pdev_create; 955 953 } 956 954 wiz->serdes_pdev = serdes_pdev;