scsi/aic94xx/aic94xx_hwi.c: Use dma_pool_zalloc
PATCH 1/1 scsi/aic94xx/aic94xx_hwi.c: Use dma_pool_zalloc
Replaced dma_pool_alloc + memset with dma_pool_zalloc
Signed-off-by Brajeswar Ghosh <[email protected]>
Signed-off-by Souptick Joarder <[email protected]>
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/aic94xx/aic94xx_hwi.c +1 -2
@@ -1057,14 +1057,13 @@ static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha,if (ascb) { ascb->dma_scb.size =sizeof (struct scb ); - ascb->dma_scb.vaddr =dma_pool_alloc (asd_ha->scb_pool, + ascb->dma_scb.vaddr =dma_pool_zalloc (asd_ha->scb_pool, gfp_flags, &ascb->dma_scb.dma_handle);if (!ascb->dma_scb.vaddr) {kmem_cache_free (asd_ascb_cache, ascb);return NULL ; } -memset (ascb->dma_scb.vaddr,0 ,sizeof (struct scb ));asd_init_ascb (asd_ha, ascb);spin_lock_irqsave (&seq->tc_index_lock, flags);
Signature · 1 line
2.17.1
Quoted 4 lines · Souptick Joarder
Replaced
dma_pool_alloc+ memset withdma_pool_zallocSigned-off-by Brajeswar Ghosh <[email protected]>Signed-off-by Souptick Joarder <[email protected]>
Reviewed-by Kees Cook <[email protected]>
-Kees
Quoted 27 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/scsi/aic94xx/aic94xx_hwi.c +1
-3@@ -1057,14 +1057,13 @@ static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha,if (ascb) { ascb->dma_scb.size =sizeof (struct scb ); - ascb->dma_scb.vaddr =dma_pool_alloc (asd_ha->scb_pool, + ascb->dma_scb.vaddr =dma_pool_zalloc (asd_ha->scb_pool, gfp_flags, &ascb->dma_scb.dma_handle);if (!ascb->dma_scb.vaddr) {kmem_cache_free (asd_ascb_cache, ascb);return NULL ; } -memset (ascb->dma_scb.vaddr,0 ,sizeof (struct scb ));asd_init_ascb (asd_ha, ascb);spin_lock_irqsave (&seq->tc_index_lock, flags); --2.17.1
Signature · 1 line
Kees Cook
Quoted 8 lines · Kees Cook
Quoted 4 lines · Souptick Joarder
Replaced
dma_pool_alloc+ memset withdma_pool_zallocSigned-off-by Brajeswar Ghosh <[email protected]>Signed-off-by Souptick Joarder <[email protected]>Reviewed-by Kees Cook <[email protected]>
Thanks Kees.
Quoted 35 lines
-Kees
Quoted 25 lines
--- drivers/scsi/aic94xx/aic94xx_hwi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/scsi/aic94xx/aic94xx_hwi.c +1
-3@@ -1057,14 +1057,13 @@ static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha,if (ascb) { ascb->dma_scb.size =sizeof (struct scb ); - ascb->dma_scb.vaddr =dma_pool_alloc (asd_ha->scb_pool, + ascb->dma_scb.vaddr =dma_pool_zalloc (asd_ha->scb_pool, gfp_flags, &ascb->dma_scb.dma_handle);if (!ascb->dma_scb.vaddr) {kmem_cache_free (asd_ascb_cache, ascb);return NULL ; } -memset (ascb->dma_scb.vaddr,0 ,sizeof (struct scb ));asd_init_ascb (asd_ha, ascb);spin_lock_irqsave (&seq->tc_index_lock, flags); --Quoted 2 lines
2.17.1
--
Kees Cook
Martin K. Petersen
AppliedSouptick,
Quoted 1 line
Replaced
dma_pool_alloc+ memset withdma_pool_zalloc
Applied to 4.21/scsi-queue, thanks.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering