summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-06-16 18:13:26 +0000
committerscottl <scottl@FreeBSD.org>2007-06-16 18:13:26 +0000
commit7096f072a5682902ee09013f8f6b87f9ccefce73 (patch)
tree3f1bf6f0e2e519fb1fbc118c475fd624ab4ca917 /sys/cam
parentd9aec0df1c65793b9f1c9712293a70955de4d3eb (diff)
downloadFreeBSD-src-7096f072a5682902ee09013f8f6b87f9ccefce73.zip
FreeBSD-src-7096f072a5682902ee09013f8f6b87f9ccefce73.tar.gz
Work around a malloc locking problem.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_sa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 4f818e0..684a104 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];
OpenPOWER on IntegriCloud