From c940381b597d4d05279c3e1617217880116a3011 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 21 Sep 2011 11:51:36 +0200 Subject: [PATCH] fix warning from -Wsign-compare --- lib/scsi-lowlevel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 0aff97a..3a4138c 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -1082,7 +1082,7 @@ scsi_get_task_private_ptr(struct scsi_task *task) struct scsi_data_buffer { struct scsi_data_buffer *next; - int len; + uint32_t len; unsigned char *data; }; @@ -1091,6 +1091,9 @@ scsi_task_add_data_in_buffer(struct scsi_task *task, int len, unsigned char *buf { struct scsi_data_buffer *data_buf; + if (len < 0) { + return -1; + } data_buf = scsi_malloc(task, sizeof(struct scsi_data_buffer)); if (data_buf == NULL) { return -1;