scsi: ibmvfc: don't check for failure from mempool_alloc()
Subsystems (3)
PATCH 1/1 scsi: ibmvfc: don't check for failure from mempool_alloc()
mempool_alloc() cannot fail when passed GFP_NOIO or any other gfp setting that is permitted to sleep. So remove this pointless code.
Signed-off-by NeilBrown <[email protected]>
--- drivers/scsi/ibmvscsi/ibmvfc.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/scsi/ibmvscsi/ibmvfc.c +0 -6
@@ -3910,12 +3910,6 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, u64 scsi_id)spin_unlock_irqrestore (vhost->host->host_lock, flags); tgt =mempool_alloc (vhost->tgt_pool,GFP_NOIO ); -if (!tgt) { -dev_err (vhost->dev,"Target allocation failure for scsi id %08llx\n" , - scsi_id); -return -ENOMEM ; - } -memset (tgt,0 ,sizeof (*tgt)); tgt->scsi_id = scsi_id; tgt->new_scsi_id = scsi_id;
Signature · 1 line
2.12.2
Quoted 6 lines · NeilBrown
mempool_alloc()cannot fail when passedGFP_NOIOor any other gfp setting that is permitted to sleep. So remove this pointless code.Signed-off-by NeilBrown <[email protected]>
Acked-by Tyrel Datwyler <[email protected]>
Quoted 22 lines
--- drivers/scsi/ibmvscsi/ibmvfc.c | 6 ------ 1 file changed, 6 deletions(-)drivers/scsi/ibmvscsi/ibmvfc.c +0
-6@@ -3910,12 +3910,6 @@ static int ibmvfc_alloc_target(struct ibmvfc_host *vhost, u64 scsi_id)spin_unlock_irqrestore (vhost->host->host_lock, flags); tgt =mempool_alloc (vhost->tgt_pool,GFP_NOIO ); -if (!tgt) { -dev_err (vhost->dev,"Target allocation failure for scsi id %08llx\n" , - scsi_id); -return -ENOMEM ; - } -memset (tgt,0 ,sizeof (*tgt)); tgt->scsi_id = scsi_id; tgt->new_scsi_id = scsi_id;
Martin K. Petersen
AppliedQuoted 2 lines · NeilBrown
mempool_alloc()cannot fail when passedGFP_NOIOor any other gfp setting that is permitted to sleep. So remove this pointless code.
Applied to 4.12/scsi-queue. Thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering