Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Nov 2009 06:42:55 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r198842 - projects/mips/sys/mips/mips
Message-ID:  <200911030642.nA36gtVx082375@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Tue Nov  3 06:42:55 2009
New Revision: 198842
URL: http://svn.freebsd.org/changeset/base/198842

Log:
  - Handle errors when adding children to nexus. This sittuation
      might occure when there is dublicate of child's entry in hints

Modified:
  projects/mips/sys/mips/mips/nexus.c

Modified: projects/mips/sys/mips/mips/nexus.c
==============================================================================
--- projects/mips/sys/mips/mips/nexus.c	Tue Nov  3 05:53:48 2009	(r198841)
+++ projects/mips/sys/mips/mips/nexus.c	Tue Nov  3 06:42:55 2009	(r198842)
@@ -257,6 +257,8 @@ nexus_hinted_child(device_t bus, const c
 	int	mem_hints_count;
 
 	child = BUS_ADD_CHILD(bus, 0, dname, dunit);
+	if (child == NULL)
+		return;
 
 	/*
 	 * Set hard-wired resources for hinted child using
@@ -306,6 +308,10 @@ nexus_add_child(device_t bus, int order,
 	resource_list_init(&ndev->nx_resources);
 
 	child = device_add_child_ordered(bus, order, name, unit);
+	if (child == NULL) {
+		device_printf(bus, "failed to add child: %s%d\n", name, unit);
+		return (0);
+	}
 
 	/* should we free this in nexus_child_detached? */
 	device_set_ivars(child, ndev);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911030642.nA36gtVx082375>