diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2020-04-27 11:33:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-27 22:27:59 +0200 |
commit | 2ac757e4152e3322a04a6dfb3d1fa010d3521abf (patch) | |
tree | 215dc5e3aef47c45e29f57c9206769d0196b3592 /drivers/net/ethernet/ti | |
parent | r8169: improve error message if no dedicated PHY driver is found (diff) | |
download | linux-2ac757e4152e3322a04a6dfb3d1fa010d3521abf.tar.xz linux-2ac757e4152e3322a04a6dfb3d1fa010d3521abf.zip |
net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name()
In case of error, the function gen_pool_create() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index ad7cfc1316ce..38cc12f9f133 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -64,8 +64,8 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, return ERR_PTR(-ENOMEM); pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1); - if (IS_ERR(pool->gen_pool)) { - ret = PTR_ERR(pool->gen_pool); + if (!pool->gen_pool) { + ret = -ENOMEM; dev_err(pool->dev, "pool create failed %d\n", ret); kfree_const(pool_name); goto gen_pool_create_fail; |