diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2020-05-20 05:41:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-22 02:14:18 +0200 |
commit | 3469660d1b15ccfdf7b33295c306b6298ca730aa (patch) | |
tree | 965116c1da5b2d6c02070e8e4211b1e436cb61ab /drivers/net/ethernet/ti/netcp_ethss.c | |
parent | net: qrtr: Fix passing invalid reference to qrtr_local_enqueue() (diff) | |
download | linux-3469660d1b15ccfdf7b33295c306b6298ca730aa.tar.xz linux-3469660d1b15ccfdf7b33295c306b6298ca730aa.zip |
net: ethernet: ti: fix some return value check of cpsw_ale_create()
cpsw_ale_create() can return both NULL and PTR_ERR(), but all of
the caller only check NULL for error handling. This patch convert
it to only return PTR_ERR() in all error cases, and the caller using
IS_ERR() instead of NULL test.
Fixes: 4b41d3436796 ("net: ethernet: ti: cpsw: allow untagged traffic on host port")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/ti/netcp_ethss.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c index fb36115e9c51..fdbae734acce 100644 --- a/drivers/net/ethernet/ti/netcp_ethss.c +++ b/drivers/net/ethernet/ti/netcp_ethss.c @@ -3704,9 +3704,9 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev, ale_params.nu_switch_ale = true; } gbe_dev->ale = cpsw_ale_create(&ale_params); - if (!gbe_dev->ale) { + if (IS_ERR(gbe_dev->ale)) { dev_err(gbe_dev->dev, "error initializing ale engine\n"); - ret = -ENODEV; + ret = PTR_ERR(gbe_dev->ale); goto free_sec_ports; } else { dev_dbg(gbe_dev->dev, "Created a gbe ale engine\n"); |