Author: imp
Date: Tue Jun 25 06:14:31 2019
New Revision: 349360
URL: https://svnweb.freebsd.org/changeset/base/349360

Log:
  Replay r349342 by imp accidentally reverted by r349352
  
  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.

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:26 2019        (r349359)
+++ head/sys/cam/scsi/scsi_da.c Tue Jun 25 06:14:31 2019        (r349360)
@@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$");
 #include <cam/cam_ccb.h>
 #include <cam/cam_periph.h>
 #include <cam/cam_xpt_periph.h>
+#ifdef _KERNEL
+#include <cam/cam_xpt_internal.h>
+#endif /* _KERNEL */
 #include <cam/cam_sim.h>
 #include <cam/cam_iosched.h>
 
@@ -3613,16 +3616,8 @@ out:
                        break;
                }
 
-               ata_params = (struct ata_params*)
-                       malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO);
+               ata_params = &periph->path->device->ident_data;
 
-               if (ata_params == NULL) {
-                       xpt_print(periph->path, "Couldn't malloc ata_params "
-                           "data\n");
-                       /* da_free_periph??? */
-                       break;
-               }
-
                scsi_ata_identify(&start_ccb->csio,
                                  /*retries*/da_retry_count,
                                  /*cbfcnp*/dadone_probeata,
@@ -5294,7 +5289,6 @@ dadone_probeata(struct cam_periph *periph, union ccb *
                }
        }
 
-       free(ata_params, M_SCSIDA);
        if ((softc->zone_mode == DA_ZONE_HOST_AWARE)
         || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) {
                /*
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to