RDMA/mana_ib: Fix error code in probe()
Return -ENOMEM if dma_pool_create() fails. Don't return success.
Fixes: df91c470d9 ("RDMA/mana_ib: create/destroy AH")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/2bbe900e-18b3-46b5-a08c-42eb71886da6@stanley.mountain
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
committed by
Leon Romanovsky
parent
ccca5e8aa1
commit
607a7dcf2e
@@ -151,8 +151,10 @@ static int mana_ib_probe(struct auxiliary_device *adev,
|
||||
|
||||
dev->av_pool = dma_pool_create("mana_ib_av", mdev->gdma_context->dev,
|
||||
MANA_AV_BUFFER_SIZE, MANA_AV_BUFFER_SIZE, 0);
|
||||
if (!dev->av_pool)
|
||||
if (!dev->av_pool) {
|
||||
ret = -ENOMEM;
|
||||
goto destroy_rnic;
|
||||
}
|
||||
|
||||
ret = ib_register_device(&dev->ib_dev, "mana_%d",
|
||||
mdev->gdma_context->dev);
|
||||
|
||||
Reference in New Issue
Block a user