* [PATCH]: Remove kfree, and fix pcidev_info struct removals
@ 2006-02-06 18:53 Prarit Bhargava
2006-02-06 19:47 ` Prarit Bhargava
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Prarit Bhargava @ 2006-02-06 18:53 UTC (permalink / raw)
To: linux-ia64
Remove an erroneous kfree, and unlink the pcidev_info struct from the
pcidev_info list prior to free'ing the pcidev_info struct.
Signed-off-by: Prarit Bhargava <prarit@sgi.com>
---
commit 2c57ee96e0e2da932adc8aa2c2ff5422456ccf3c
tree 8d2ed800415f31e4c455ccae295a8c432b7b70b4
parent 7c6c66362941df847957766ad133ff5fde67579c
author Prarit Bhargava <prarit@sgi.com> Mon, 06 Feb 2006 14:39:37 -0500
committer Prarit Bhargava <prarit@sgi.com> Mon, 06 Feb 2006 14:39:37 -0500
arch/ia64/sn/kernel/io_init.c | 2 ++
arch/ia64/sn/kernel/irq.c | 4 +---
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index d7e4d79..2e4e56b 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -623,6 +623,8 @@ sn_sysdata_free_start:
list_for_each(list, &sn_sysdata_list) {
element = list_entry(list, struct sysdata_el, entry);
list_del(&element->entry);
+ list_del(&(((struct pcidev_info *)
+ (element->sysdata))->pdi_list));
kfree(element->sysdata);
kfree(element);
goto sn_sysdata_free_start;
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 74d87d9..3187828 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -299,10 +299,8 @@ void sn_irq_unfixup(struct pci_dev *pci_
return;
sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info;
- if (!sn_irq_info || !sn_irq_info->irq_irq) {
- kfree(sn_irq_info);
+ if (!sn_irq_info || !sn_irq_info->irq_irq)
return;
- }
unregister_intr_pda(sn_irq_info);
spin_lock(&sn_irq_info_lock);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH]: Remove kfree, and fix pcidev_info struct removals
2006-02-06 18:53 [PATCH]: Remove kfree, and fix pcidev_info struct removals Prarit Bhargava
@ 2006-02-06 19:47 ` Prarit Bhargava
2006-02-07 7:38 ` Chen, Kenneth W
2006-02-07 20:11 ` Prarit Bhargava
2 siblings, 0 replies; 4+ messages in thread
From: Prarit Bhargava @ 2006-02-06 19:47 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 11 bytes --]
New patch.
[-- Attachment #2: hpfix.patch --]
[-- Type: text/plain, Size: 1610 bytes --]
Two Hotplug driver related fixes in the SN ia64 code.
Remove an erroneous kfree, and unlink the pcidev_info struct from the
pcidev_info list prior to free'ing the pcidev_info struct.
Signed-off-by: Prarit Bhargava <prarit@sgi.com>
---
commit 1ad024b793f5f1aa1cf098a19430298e2a66bc40
tree 4c269432f9b58145a39fd65bcbc671f23b4c83c8
parent 7c6c66362941df847957766ad133ff5fde67579c
author Prarit Bhargava <prarit@sgi.com> Mon, 06 Feb 2006 15:38:47 -0500
committer Prarit Bhargava <prarit@sgi.com> Mon, 06 Feb 2006 15:38:47 -0500
arch/ia64/sn/kernel/io_init.c | 2 ++
arch/ia64/sn/kernel/irq.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index d7e4d79..2e4e56b 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -623,6 +623,8 @@ sn_sysdata_free_start:
list_for_each(list, &sn_sysdata_list) {
element = list_entry(list, struct sysdata_el, entry);
list_del(&element->entry);
+ list_del(&(((struct pcidev_info *)
+ (element->sysdata))->pdi_list));
kfree(element->sysdata);
kfree(element);
goto sn_sysdata_free_start;
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 74d87d9..c373113 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -299,7 +299,9 @@ void sn_irq_unfixup(struct pci_dev *pci_
return;
sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info;
- if (!sn_irq_info || !sn_irq_info->irq_irq) {
+ if (!sn_irq_info)
+ return;
+ if (!sn_irq_info->irq_irq) {
kfree(sn_irq_info);
return;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH]: Remove kfree, and fix pcidev_info struct removals
2006-02-06 18:53 [PATCH]: Remove kfree, and fix pcidev_info struct removals Prarit Bhargava
2006-02-06 19:47 ` Prarit Bhargava
@ 2006-02-07 7:38 ` Chen, Kenneth W
2006-02-07 20:11 ` Prarit Bhargava
2 siblings, 0 replies; 4+ messages in thread
From: Chen, Kenneth W @ 2006-02-07 7:38 UTC (permalink / raw)
To: linux-ia64
Prarit Bhargava wrote on Monday, February 06, 2006 11:48 AM
> New patch.
>
> diff --git a/arch/ia64/sn/kernel/io_init.c
b/arch/ia64/sn/kernel/io_init.c
> index d7e4d79..2e4e56b 100644
> --- a/arch/ia64/sn/kernel/io_init.c
> +++ b/arch/ia64/sn/kernel/io_init.c
> @@ -623,6 +623,8 @@ sn_sysdata_free_start:
> list_for_each(list, &sn_sysdata_list) {
> element = list_entry(list, struct sysdata_el, entry);
> list_del(&element->entry);
> + list_del(&(((struct pcidev_info *)
> + (element->sysdata))->pdi_list));
> kfree(element->sysdata);
> kfree(element);
> goto sn_sysdata_free_start;
Nothing in particular picky about this patch. However, in
sn_bus_free_sysdata(), the goto that branches outside the
list_for_each loop looks like it needs a real clean up. How
about using list_for_each_entry_safe?
- Ken
Excerpt of function sn_bus_free_sysdata():
void sn_bus_free_sysdata(void)
{
struct sysdata_el *element;
struct list_head *list;
sn_sysdata_free_start:
list_for_each(list, &sn_sysdata_list) {
element = list_entry(list, struct sysdata_el, entry);
list_del(&element->entry);
kfree(element->sysdata);
kfree(element);
goto sn_sysdata_free_start;
}
return;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH]: Remove kfree, and fix pcidev_info struct removals
2006-02-06 18:53 [PATCH]: Remove kfree, and fix pcidev_info struct removals Prarit Bhargava
2006-02-06 19:47 ` Prarit Bhargava
2006-02-07 7:38 ` Chen, Kenneth W
@ 2006-02-07 20:11 ` Prarit Bhargava
2 siblings, 0 replies; 4+ messages in thread
From: Prarit Bhargava @ 2006-02-07 20:11 UTC (permalink / raw)
To: linux-ia64
>
> Nothing in particular picky about this patch. However, in
> sn_bus_free_sysdata(), the goto that branches outside the
> list_for_each loop looks like it needs a real clean up. How
> about using list_for_each_entry_safe?
>
Kenneth,
I'm implementing this change in a separate patch (which will be out
shortly).
P.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-07 20:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 18:53 [PATCH]: Remove kfree, and fix pcidev_info struct removals Prarit Bhargava
2006-02-06 19:47 ` Prarit Bhargava
2006-02-07 7:38 ` Chen, Kenneth W
2006-02-07 20:11 ` Prarit Bhargava
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox