Commit bc7896d3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: mpi3mr: Return error if dma_alloc_coherent() fails

Return -ENOMEM instead of success if dma_alloc_coherent() fails.

Link: https://lore.kernel.org/r/YnOmMGHqCOtUCYQ1@kili
Fixes: 43ca1100 ("scsi: mpi3mr: Add support for PEL commands")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e9dedc13
......@@ -3754,8 +3754,10 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
mrioc->pel_seqnum_virt = dma_alloc_coherent(&mrioc->pdev->dev,
mrioc->pel_seqnum_sz, &mrioc->pel_seqnum_dma,
GFP_KERNEL);
if (!mrioc->pel_seqnum_virt)
if (!mrioc->pel_seqnum_virt) {
retval = -ENOMEM;
goto out_failed_noretry;
}
}
retval = mpi3mr_enable_events(mrioc);
......@@ -3873,8 +3875,10 @@ int mpi3mr_reinit_ioc(struct mpi3mr_ioc *mrioc, u8 is_resume)
mrioc->pel_seqnum_virt = dma_alloc_coherent(&mrioc->pdev->dev,
mrioc->pel_seqnum_sz, &mrioc->pel_seqnum_dma,
GFP_KERNEL);
if (!mrioc->pel_seqnum_virt)
if (!mrioc->pel_seqnum_virt) {
retval = -ENOMEM;
goto out_failed_noretry;
}
}
if (mrioc->shost->nr_hw_queues > mrioc->num_op_reply_q) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment