lkml.org 
[lkml]   [2005]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Fix ide-disk.c oops caused by hwif == NULL
On Wed, 10 Aug 2005, Geert Uytterhoeven wrote:

> On Tue, 9 Aug 2005, Linux Kernel Mailing List wrote:
> > tree 518f62158f0923573decb8f072ac7282fb7575cb
> > parent aeb3f76350e78aba90653b563de6677b442d21d6
> > author Christoph Lameter <christoph@lameter.com> Wed, 10 Aug 2005 09:59:21 -0700
> > committer Linus Torvalds <torvalds@g5.osdl.org> Wed, 10 Aug 2005 10:21:31 -0700
> >
> > [PATCH] Fix ide-disk.c oops caused by hwif == NULL
>
> How can this patch fix that? It still dereferences hwif without checking for a
> NULL pointer.

Correct. So we need to indeed go back to a version that does check for
NULL that I initially proposed.

Index: linux-2.6/include/linux/ide.h
===================================================================
--- linux-2.6.orig/include/linux/ide.h 2005-08-09 19:47:14.000000000 -0700
+++ linux-2.6/include/linux/ide.h 2005-08-10 06:05:44.000000000 -0700
@@ -1503,7 +1503,7 @@

static inline int hwif_to_node(ide_hwif_t *hwif)
{
- if (hwif->pci_dev)
+ if (hwif && hwif->pci_dev)
return pcibus_to_node(hwif->pci_dev->bus);
else
/* Add ways to determine the node of other busses here */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-08-10 15:10    [W:0.048 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site