[PATCH] PCI: fix pci_remove_legacy_files() crash

2005-03-04 Thread Greg KH
ChangeSet 1.1998.11.11, 2005/02/07 16:20:26-08:00, [EMAIL PROTECTED]

[PATCH] PCI: fix pci_remove_legacy_files() crash

The legacy_io which is the member of pci_bus struct might be
NULL. It should be checked.

This patch checks 'b->legacy_io', NULL or not.

Signed-off-by: MUNEDA Takahiro <[EMAIL PROTECTED]>
Acked-by: Jesse Barnes <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/pci/probe.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c   2005-03-04 12:42:59 -08:00
+++ b/drivers/pci/probe.c   2005-03-04 12:42:59 -08:00
@@ -64,9 +64,11 @@
 
 void pci_remove_legacy_files(struct pci_bus *b)
 {
-   class_device_remove_bin_file(>class_dev, b->legacy_io);
-   class_device_remove_bin_file(>class_dev, b->legacy_mem);
-   kfree(b->legacy_io); /* both are allocated here */
+   if (b->legacy_io) {
+   class_device_remove_bin_file(>class_dev, b->legacy_io);
+   class_device_remove_bin_file(>class_dev, b->legacy_mem);
+   kfree(b->legacy_io); /* both are allocated here */
+   }
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PCI: fix pci_remove_legacy_files() crash

2005-03-04 Thread Greg KH
ChangeSet 1.1998.11.11, 2005/02/07 16:20:26-08:00, [EMAIL PROTECTED]

[PATCH] PCI: fix pci_remove_legacy_files() crash

The legacy_io which is the member of pci_bus struct might be
NULL. It should be checked.

This patch checks 'b-legacy_io', NULL or not.

Signed-off-by: MUNEDA Takahiro [EMAIL PROTECTED]
Acked-by: Jesse Barnes [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]


 drivers/pci/probe.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c   2005-03-04 12:42:59 -08:00
+++ b/drivers/pci/probe.c   2005-03-04 12:42:59 -08:00
@@ -64,9 +64,11 @@
 
 void pci_remove_legacy_files(struct pci_bus *b)
 {
-   class_device_remove_bin_file(b-class_dev, b-legacy_io);
-   class_device_remove_bin_file(b-class_dev, b-legacy_mem);
-   kfree(b-legacy_io); /* both are allocated here */
+   if (b-legacy_io) {
+   class_device_remove_bin_file(b-class_dev, b-legacy_io);
+   class_device_remove_bin_file(b-class_dev, b-legacy_mem);
+   kfree(b-legacy_io); /* both are allocated here */
+   }
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-07 Thread Greg KH
On Fri, Feb 04, 2005 at 12:28:36PM +0900, MUNEDA Takahiro wrote:
> Hi,
> 
> The legacy_io which is the member of pci_bus struct might be
> NULL. It should be checked.
> 
> This patch checks 'b->legacy_io', NULL or not.
> 
> Signed-off-by: MUNEDA Takahiro <[EMAIL PROTECTED]>

Applied, thanks.

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-07 Thread Greg KH
On Fri, Feb 04, 2005 at 12:28:36PM +0900, MUNEDA Takahiro wrote:
 Hi,
 
 The legacy_io which is the member of pci_bus struct might be
 NULL. It should be checked.
 
 This patch checks 'b-legacy_io', NULL or not.
 
 Signed-off-by: MUNEDA Takahiro [EMAIL PROTECTED]

Applied, thanks.

greg k-h
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-04 Thread Jesse Barnes
On Thursday, February 3, 2005 7:28 pm, MUNEDA Takahiro wrote:
> Hi,
>
> The legacy_io which is the member of pci_bus struct might be
> NULL. It should be checked.
>
> This patch checks 'b->legacy_io', NULL or not.
>
> Signed-off-by: MUNEDA Takahiro <[EMAIL PROTECTED]>
>
> ---
>
>  probe.c |8 +---
>  1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff -Npur a/drivers/pci/probe.c b/drivers/pci/probe.c
> --- a/drivers/pci/probe.c 2005-01-31 13:31:27.0 +0900
> +++ b/drivers/pci/probe.c 2005-02-03 11:21:51.0 +0900
> @@ -64,9 +64,11 @@ static void pci_create_legacy_files(stru
>
>  void pci_remove_legacy_files(struct pci_bus *b)
>  {
> - class_device_remove_bin_file(>class_dev, b->legacy_io);
> - class_device_remove_bin_file(>class_dev, b->legacy_mem);
> - kfree(b->legacy_io); /* both are allocated here */
> + if (b->legacy_io) {
> +  class_device_remove_bin_file(>class_dev, b->legacy_io);
> +  class_device_remove_bin_file(>class_dev, b->legacy_mem);
> +  kfree(b->legacy_io); /* both are allocated here */
> + }
>  }
>  #else /* !HAVE_PCI_LEGACY */
>  static inline void pci_create_legacy_files(struct pci_bus *bus) { return;
> }

Thanks, though the case where b->legacy_io is NULL should be very rare (it'll 
only happen if the initialization can't get memory for b->legacy_io), it's 
still a possibility so this fix is needed.

Acked-by: Jesse Barnes <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-04 Thread Jesse Barnes
On Thursday, February 3, 2005 7:28 pm, MUNEDA Takahiro wrote:
 Hi,

 The legacy_io which is the member of pci_bus struct might be
 NULL. It should be checked.

 This patch checks 'b-legacy_io', NULL or not.

 Signed-off-by: MUNEDA Takahiro [EMAIL PROTECTED]

 ---

  probe.c |8 +---
  1 files changed, 5 insertions(+), 3 deletions(-)

 diff -Npur a/drivers/pci/probe.c b/drivers/pci/probe.c
 --- a/drivers/pci/probe.c 2005-01-31 13:31:27.0 +0900
 +++ b/drivers/pci/probe.c 2005-02-03 11:21:51.0 +0900
 @@ -64,9 +64,11 @@ static void pci_create_legacy_files(stru

  void pci_remove_legacy_files(struct pci_bus *b)
  {
 - class_device_remove_bin_file(b-class_dev, b-legacy_io);
 - class_device_remove_bin_file(b-class_dev, b-legacy_mem);
 - kfree(b-legacy_io); /* both are allocated here */
 + if (b-legacy_io) {
 +  class_device_remove_bin_file(b-class_dev, b-legacy_io);
 +  class_device_remove_bin_file(b-class_dev, b-legacy_mem);
 +  kfree(b-legacy_io); /* both are allocated here */
 + }
  }
  #else /* !HAVE_PCI_LEGACY */
  static inline void pci_create_legacy_files(struct pci_bus *bus) { return;
 }

Thanks, though the case where b-legacy_io is NULL should be very rare (it'll 
only happen if the initialization can't get memory for b-legacy_io), it's 
still a possibility so this fix is needed.

Acked-by: Jesse Barnes [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-03 Thread MUNEDA Takahiro
Hi,

The legacy_io which is the member of pci_bus struct might be
NULL. It should be checked.

This patch checks 'b->legacy_io', NULL or not.

Signed-off-by: MUNEDA Takahiro <[EMAIL PROTECTED]>

---

 probe.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -Npur a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c   2005-01-31 13:31:27.0 +0900
+++ b/drivers/pci/probe.c   2005-02-03 11:21:51.0 +0900
@@ -64,9 +64,11 @@ static void pci_create_legacy_files(stru

 void pci_remove_legacy_files(struct pci_bus *b)
 {
-   class_device_remove_bin_file(>class_dev, b->legacy_io);
-   class_device_remove_bin_file(>class_dev, b->legacy_mem);
-   kfree(b->legacy_io); /* both are allocated here */
+   if (b->legacy_io) {
+   class_device_remove_bin_file(>class_dev, b->legacy_io);
+   class_device_remove_bin_file(>class_dev, b->legacy_mem);
+   kfree(b->legacy_io); /* both are allocated here */
+   }
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PCI: fix pci_remove_legacy_files() crash

2005-02-03 Thread MUNEDA Takahiro
Hi,

The legacy_io which is the member of pci_bus struct might be
NULL. It should be checked.

This patch checks 'b-legacy_io', NULL or not.

Signed-off-by: MUNEDA Takahiro [EMAIL PROTECTED]

---

 probe.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -Npur a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c   2005-01-31 13:31:27.0 +0900
+++ b/drivers/pci/probe.c   2005-02-03 11:21:51.0 +0900
@@ -64,9 +64,11 @@ static void pci_create_legacy_files(stru

 void pci_remove_legacy_files(struct pci_bus *b)
 {
-   class_device_remove_bin_file(b-class_dev, b-legacy_io);
-   class_device_remove_bin_file(b-class_dev, b-legacy_mem);
-   kfree(b-legacy_io); /* both are allocated here */
+   if (b-legacy_io) {
+   class_device_remove_bin_file(b-class_dev, b-legacy_io);
+   class_device_remove_bin_file(b-class_dev, b-legacy_mem);
+   kfree(b-legacy_io); /* both are allocated here */
+   }
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/