diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 1704a943e28c..6beed413fe9e 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -2236,15 +2236,16 @@ umass_cam_rescan(void *addr) { struct umass_softc *sc = (struct umass_softc *) addr; struct cam_path *path; - union ccb *ccb = malloc(sizeof(union ccb), M_USBDEV, M_WAITOK); - - memset(ccb, 0, sizeof(union ccb)); + union ccb *ccb; DPRINTF(UDMASS_SCSI, ("scbus%d: scanning for %s:%d:%d:%d\n", cam_sim_path(sc->umass_sim), USBDEVNAME(sc->sc_dev), cam_sim_path(sc->umass_sim), USBDEVUNIT(sc->sc_dev), CAM_LUN_WILDCARD)); + ccb = malloc(sizeof(union ccb), M_USBDEV, M_NOWAIT | M_ZERO); + if (ccb == NULL) + return; if (xpt_create_path(&path, xpt_periph, cam_sim_path(sc->umass_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)