From 52470d49100207aac7f422675865827e24d3aa94 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 6 Dec 2023 16:05:43 +0100 Subject: [PATCH] Fixed an off by 1 error in scsi/scsi_disk.c, fixes NetBSD 7 hang when probing a SCSI hard disk. --- src/scsi/scsi_disk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index 93d29a672..c886ce9a4 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -129,6 +129,7 @@ static void scsi_disk_mode_sense_load(scsi_disk_t *dev); static void scsi_disk_init(scsi_disk_t *dev); +#define ENABLE_SCSI_DISK_LOG 1 #ifdef ENABLE_SCSI_DISK_LOG int scsi_disk_do_log = ENABLE_SCSI_DISK_LOG; @@ -709,7 +710,7 @@ static int scsi_disk_blocks(scsi_disk_t *dev, int32_t *len, UNUSED(int first_batch), int out) { *len = 0; - uint32_t medium_size = hdd_image_get_last_sector(dev->id); + uint32_t medium_size = hdd_image_get_last_sector(dev->id) + 1; if (!dev->sector_len) { scsi_disk_command_complete(dev);