From ddd8ed26ea63dea42d5f811fcd1e78a1174293f2 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sat, 16 Jun 2007 18:13:26 +0000 Subject: [PATCH] Work around a malloc locking problem. --- sys/cam/scsi/scsi_sa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 4f818e03eca..684a1046347 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -2543,7 +2543,12 @@ retry: mode_buffer_len += sizeof (sa_comp_t); } - mode_buffer = malloc(mode_buffer_len, M_SCSISA, M_WAITOK | M_ZERO); + /* XXX Fix M_NOWAIT */ + mode_buffer = malloc(mode_buffer_len, M_SCSISA, M_NOWAIT | M_ZERO); + if (mode_buffer == NULL) { + xpt_release_ccb(ccb); + return (ENOMEM); + } mode_hdr = (struct scsi_mode_header_6 *)mode_buffer; mode_blk = (struct scsi_mode_blk_desc *)&mode_hdr[1];