linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: Fix a theoretical Ooops case
@ 2007-06-22 13:20 Alan Cox
  2007-06-23 17:41 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2007-06-22 13:20 UTC (permalink / raw)
  To: akpm, bzolnier, linux-ide

Found by a static analyser. It is in theory possible we dereference
dev->id when it has become invalid. Re-order to avoid this.

Not needed for new-ide as we no longer support the crazy exabyte nest stuff

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc4-mm2/drivers/ide/ide-probe.c linux-2.6.22-rc4-mm2/drivers/ide/ide-probe.c
--- linux.vanilla-2.6.22-rc4-mm2/drivers/ide/ide-probe.c	2007-06-07 14:26:08.000000000 +0100
+++ linux-2.6.22-rc4-mm2/drivers/ide/ide-probe.c	2007-06-18 16:45:28.000000000 +0100
@@ -574,11 +574,11 @@
 			/* look for ATAPI device */
 			(void) do_probe(drive, WIN_PIDENTIFY);
 		}
-		if (strstr(drive->id->model, "E X A B Y T E N E S T"))
-			enable_nest(drive);
 		if (!drive->present)
 			/* drive not found */
 			return 0;
+		if (strstr(drive->id->model, "E X A B Y T E N E S T"))
+			enable_nest(drive);
 	
 		/* identification failed? */
 		if (!drive->id_read) {

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

* Re: [PATCH] ide: Fix a theoretical Ooops case
  2007-06-22 13:20 [PATCH] ide: Fix a theoretical Ooops case Alan Cox
@ 2007-06-23 17:41 ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-06-23 17:41 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide

On Friday 22 June 2007, Alan Cox wrote:
> Found by a static analyser. It is in theory possible we dereference
> dev->id when it has become invalid. Re-order to avoid this.
> 
> Not needed for new-ide as we no longer support the crazy exabyte nest stuff
> 
> Signed-off-by: Alan Cox <alan@redhat.com>

applied

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

end of thread, other threads:[~2007-06-23 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-22 13:20 [PATCH] ide: Fix a theoretical Ooops case Alan Cox
2007-06-23 17:41 ` 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).