[PATCH] ide-generic: Fix no initalization of idx in some case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johann Felix Soden <johfel@xxxxxxxxxxxxxxxxxxxxx>

If the slot is already occupied, there should be written 0xff to idx[i].
In the ongoing code and in this case there are no writings to idx[i], so
garbage stays in idx. The kernel get into a endless loop printing:

: I/O resource 0x0-0x0 not free.
Trying to free nonexistent resource <0000000000000000-0000000000000000>
Trying to free nonexistent resource <0000000000000000-0000000000000000>

This patch solves http://article.gmane.org/gmane.linux.ide/28810 .

Signed-off-by: Johann Felix Soden <johfel@xxxxxxxxxxxxxxxxxxxxx>
CC: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
---
 drivers/ide/ide-generic.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 5499a77..fb9865c 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -103,7 +103,10 @@ static int __init ide_generic_init(void)
 			 */
 			hwif = ide_find_port();
 			if (hwif == NULL || hwif->index != i)
+			{
+				idx[i] = 0xff;
 				continue;
+			}
 
 			memset(&hw, 0, sizeof(hw));
 			ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
-- 
1.5.4.2

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux