Skip to content

Commit

Permalink
net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create…
Browse files Browse the repository at this point in the history
…_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: 93a7653 ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wei Yongjun authored and davem330 committed Apr 27, 2020
1 parent 0c2006b commit 2ac757e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/ti/k3-cppi-desc-pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2ac757e

Please sign in to comment.