svn commit: r367953 - head/sys/dev/firewire

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Nov 23 13:05:11 UTC 2020


Author: trasz
Date: Mon Nov 23 13:05:11 2020
New Revision: 367953
URL: https://svnweb.freebsd.org/changeset/base/367953

Log:
  Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
  
  Reviewed by:	imp, mav
  MFC after:	2 weeks
  Sponsored by:	NetApp, Inc.
  Sponsored by:	Klara, Inc.
  Differential Revision:	https://reviews.freebsd.org/D26843

Modified:
  head/sys/dev/firewire/sbp.c

Modified: head/sys/dev/firewire/sbp.c
==============================================================================
--- head/sys/dev/firewire/sbp.c	Mon Nov 23 13:02:23 2020	(r367952)
+++ head/sys/dev/firewire/sbp.c	Mon Nov 23 13:05:11 2020	(r367953)
@@ -987,7 +987,7 @@ END_DEBUG
 	sdev = sbp_next_dev(target, sdev->lun_id + 1);
 	if (sdev == NULL) {
 		SBP_UNLOCK(sbp);
-		free(ccb, M_SBP);
+		xpt_free_ccb(ccb);
 		return;
 	}
 	/* reuse ccb */
@@ -1019,9 +1019,9 @@ SBP_DEBUG(0)
 	device_printf(sdev->target->sbp->fd.dev,
 		"%s:%s\n", __func__, sdev->bustgtlun);
 END_DEBUG
-	ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO);
+	ccb = xpt_alloc_ccb_nowait();
 	if (ccb == NULL) {
-		printf("sbp_cam_scan_target: malloc failed\n");
+		printf("sbp_cam_scan_target: xpt_alloc_ccb_nowait() failed\n");
 		return;
 	}
 	SBP_UNLOCK(target->sbp);


More information about the svn-src-head mailing list