Skip to contentSkip to conversation

scsi: aic79xx: Use kzalloc instead of kmalloc/memset

PATCH New Daeseok Youn 1 participant 1 message Jan 28, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/4 scsi: aic79xx: Use kzalloc instead of kmalloc/memset

---
 drivers/scsi/aic7xxx/aic79xx_core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/scsi/aic7xxx/aic79xx_core.c +1 -2
index 97f2acc..109e2c9 100644
@@ -10437,14 +10437,13 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
 				return;
 			}
 		}
-		lstate = kmalloc(sizeof(*lstate), GFP_ATOMIC);
+		lstate = kzalloc(sizeof(*lstate), GFP_ATOMIC);
 		if (lstate = NULL) {
 			xpt_print_path(ccb->ccb_h.path);
 			printk("Couldn't allocate lstate\n");
 			ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
 			return;
 		}
-		memset(lstate, 0, sizeof(*lstate));
 		status = xpt_create_path(&lstate->path, /*periph*/NULL,
 					 xpt_path_path_id(ccb->ccb_h.path),
 					 xpt_path_target_id(ccb->ccb_h.path),
Signature · 1 line
1.7.1