From 6f45fadf5a2d867fc1609816fd1dd51a8f01766b Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 23 Nov 2020 13:05:11 +0000 Subject: [PATCH] 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 --- sys/dev/firewire/sbp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 04e454d6c66e..72fe6d9b4454 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -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);