From 6e5e4d01cefda41da506c0c184f54e78796b37d1 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Thu, 22 Sep 2011 20:52:49 +0200 Subject: [PATCH] hdt: Don't search HDDs when no HDD got detected --- com32/hdt/hdt-dump-disks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com32/hdt/hdt-dump-disks.c b/com32/hdt/hdt-dump-disks.c index bde04d2..ff744b3 100644 --- a/com32/hdt/hdt-dump-disks.c +++ b/com32/hdt/hdt-dump-disks.c @@ -123,7 +123,9 @@ void show_disk(struct s_hardware *hardware, ZZJSON_CONFIG *conf, ZZJSON **it, in void dump_disks(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) { bool found=false; - for (int drive = 0x80; drive < 0xff; drive++) { + + if (hardware->disks_count > 0) + for (int drive = 0x80; drive < 0xff; drive++) { if (hardware->disk_info[drive - 0x80].cbios) { if (found==false) { CREATE_NEW_OBJECT; -- 2.7.4