All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: linuxppc-dev@ozlabs.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackeras <paulus@samba.org>
Subject: [PATCH] missing refcounting of of_find_node_by_name users
Date: Sat, 4 Feb 2006 13:20:13 +0100	[thread overview]
Message-ID: <20060204122013.GA20324@suse.de> (raw)
In-Reply-To: <20060204115541.GB19392@suse.de>


drop the refcount of the node returned from of_find_node_by_name

Signed-off-by: Olaf Hering <olh@suse.de>

 arch/powerpc/platforms/powermac/feature.c |    5 +++++
 arch/powerpc/platforms/powermac/pci.c     |    1 +
 arch/powerpc/platforms/powermac/pic.c     |    1 +
 arch/powerpc/platforms/powermac/smp.c     |    1 +
 arch/powerpc/platforms/pseries/eeh.c      |    1 +
 arch/powerpc/platforms/pseries/setup.c    |    1 +
 drivers/char/hvc_vio.c                    |    1 +
 drivers/serial/pmac_zilog.c               |    1 +
 8 files changed, 12 insertions(+)

Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/feature.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/feature.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/feature.c
@@ -2772,6 +2772,7 @@ set_initial_features(void)
 				g5_gmac_enable(np, 0, 1);
 			np = of_find_node_by_name(np, "ethernet");
 		}
+		of_node_put(np);
 
 		/* Enable FW before PCI probe. Will be disabled later on
 		 * Note: We should have a batter way to check that we are
@@ -2786,6 +2787,7 @@ set_initial_features(void)
 			}
 			np = of_find_node_by_name(np, "firewire");
 		}
+		of_node_put(np);
 	}
 #else /* CONFIG_POWER4 */
 
@@ -2803,6 +2805,7 @@ set_initial_features(void)
 				core99_gmac_enable(np, 0, 1);
 			np = of_find_node_by_name(np, "ethernet");
 		}
+		of_node_put(np);
 
 		/* Enable FW before PCI probe. Will be disabled later on
 		 * Note: We should have a batter way to check that we are
@@ -2821,6 +2824,7 @@ set_initial_features(void)
 			}
 			np = of_find_node_by_name(np, "firewire");
 		}
+		of_node_put(np);
 
 		/* Enable ATA-100 before PCI probe. */
 		np = of_find_node_by_name(NULL, "ata-6");
@@ -2832,6 +2836,7 @@ set_initial_features(void)
 			}
 			np = of_find_node_by_name(np, "ata-6");
 		}
+		of_node_put(np);
 
 		/* Switch airport off */
 		np = find_devices("radio");
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pci.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/pci.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pci.c
@@ -695,6 +695,7 @@ static void __init fixup_nec_usb2(void)
 				nec->intrs[0].line);
 		}
 	}
+	of_put_node(nec);
 }
 
 static void __init setup_bandit(struct pci_controller *hose,
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/pic.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/pic.c
@@ -658,6 +658,7 @@ static int pmacpic_find_viaint(void)
 	if (np == NULL)
 		goto not_found;
 	viaint = np->intrs[0].line;
+	of_node_put(np);
 #endif /* CONFIG_ADB_PMU */
 
 not_found:
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/smp.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/powermac/smp.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/powermac/smp.c
@@ -588,6 +588,7 @@ static void __init smp_core99_setup_i2c_
 		if (pmac_tb_freeze != NULL)
 			break;
 	}
+	of_node_put(cc);
 	if (pmac_tb_freeze != NULL) {
 		/* Open i2c bus for synchronous access */
 		if (pmac_i2c_open(pmac_tb_clock_chip_host, 1)) {
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/pseries/eeh.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/pseries/eeh.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/pseries/eeh.c
@@ -846,6 +846,7 @@ void __init eeh_init(void)
 		info.buid_hi = BUID_HI(buid);
 		traverse_pci_devices(phb, early_enable_eeh, &info);
 	}
+	of_node_put(phb);
 
 	if (eeh_subsystem_enabled)
 		printk(KERN_INFO "EEH: PCI Enhanced I/O Error Handling Enabled\n");
Index: linux-2.6.16-rc2-olh/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/arch/powerpc/platforms/pseries/setup.c
+++ linux-2.6.16-rc2-olh/arch/powerpc/platforms/pseries/setup.c
@@ -330,6 +330,7 @@ static  void __init pSeries_discover_pic
 			break;
 		}
 	}
+	of_node_put(np);
 	if (ppc64_interrupt_controller == IC_INVALID)
 		printk("pSeries_discover_pic: failed to recognize"
 			" interrupt-controller\n");
Index: linux-2.6.16-rc2-olh/drivers/char/hvc_vio.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/drivers/char/hvc_vio.c
+++ linux-2.6.16-rc2-olh/drivers/char/hvc_vio.c
@@ -146,6 +146,7 @@ static int hvc_find_vtys(void)
 			++num_found;
 		}
 	}
+	of_node_put(vty);
 
 	return num_found;
 }
Index: linux-2.6.16-rc2-olh/drivers/serial/pmac_zilog.c
===================================================================
--- linux-2.6.16-rc2-olh.orig/drivers/serial/pmac_zilog.c
+++ linux-2.6.16-rc2-olh/drivers/serial/pmac_zilog.c
@@ -1767,6 +1767,7 @@ static int __init pmz_probe(void)
 next:
 		node_p = of_find_node_by_name(node_p, "escc");
 	}
+	of_node_put(node_p);
 	pmz_ports_count = count;
 
 	return 0;
-- 
short story of a lazy sysadmin:
 alias appserv=wotan

  reply	other threads:[~2006-02-04 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18 15:18 Badness in kref_get at lib/kref.c:32, of_get_parent broken Olaf Hering
2006-02-04 11:55 ` [PATCH] add refcounting to setup_peg2 and of_get_pci_address Olaf Hering
2006-02-04 12:20   ` Olaf Hering [this message]
2006-02-07 10:49     ` [PATCH] missing refcounting of of_find_node_by_name users Paul Mackerras
2006-02-07 10:58       ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060204122013.GA20324@suse.de \
    --to=olh@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.