diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-05-05 13:25:52 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-05-19 20:16:26 -0400 |
commit | bc7896d31a922ee9caabb10dc07509f65d41dc0e (patch) | |
tree | 1119c8314bad0b16bddbd5197cfed3379b9c6796 /drivers/scsi/mpi3mr | |
parent | e9dedc13bb11bc553754abecb322e5e41d1b4fef (diff) | |
download | linux-bc7896d31a922ee9caabb10dc07509f65d41dc0e.tar.bz2 |
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: 43ca11005098 ("scsi: mpi3mr: Add support for PEL commands")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpi3mr')
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_fw.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 74e09727a1b8..f1d4ea8ba989 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -3754,8 +3754,10 @@ retry_init: 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 @@ retry_init: 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) { |