From b7ba0372a1b89c2fadd1f911ac3184971ff3c45e Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 24 Jun 2019 20:23:19 +0000 Subject: [PATCH] Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. --- sys/cam/scsi/scsi_da.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index d2e66307cce..f2f60d35b2e 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3613,15 +3616,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb) break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); - - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } + ata_params = &periph->path->device->ident_data; scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, @@ -5294,7 +5289,6 @@ dadone_probeata(struct cam_periph *periph, union ccb *done_ccb) } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /* -- 2.45.0