linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide-generic: Fix no initalization of idx in some case
@ 2008-02-20 13:55 Johann Felix Soden
  2008-02-20 14:35 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Johann Felix Soden @ 2008-02-20 13:55 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Sergei Shtylyov, Kamalesh Babulal, linux-ide

From: Johann Felix Soden <johfel@users.sourceforge.net>

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@users.sourceforge.net>
CC: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-20 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 13:55 [PATCH] ide-generic: Fix no initalization of idx in some case Johann Felix Soden
2008-02-20 14:35 ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).