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: 93a7653031 ("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>
This commit is contained in:
Wei Yongjun 2020-04-27 09:33:43 +00:00 коммит произвёл David S. Miller
Родитель 0c2006b29e
Коммит 2ac757e415
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -64,8 +64,8 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size,
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1); pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1);
if (IS_ERR(pool->gen_pool)) { if (!pool->gen_pool) {
ret = PTR_ERR(pool->gen_pool); ret = -ENOMEM;
dev_err(pool->dev, "pool create failed %d\n", ret); dev_err(pool->dev, "pool create failed %d\n", ret);
kfree_const(pool_name); kfree_const(pool_name);
goto gen_pool_create_fail; goto gen_pool_create_fail;