Module Name: src
Committed By: jmcneill
Date: Wed Feb 16 23:44:20 UTC 2011
Modified Files:
src/sys/arch/sgimips/hpc: panel.c pi1ppc.c
Log Message:
validate cf_name in driver match method
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sgimips/hpc/panel.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sgimips/hpc/pi1ppc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sgimips/hpc/panel.c
diff -u src/sys/arch/sgimips/hpc/panel.c:1.1 src/sys/arch/sgimips/hpc/panel.c:1.2
--- src/sys/arch/sgimips/hpc/panel.c:1.1 Thu May 14 01:10:19 2009
+++ src/sys/arch/sgimips/hpc/panel.c Wed Feb 16 23:44:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: panel.c,v 1.1 2009/05/14 01:10:19 macallan Exp $ */
+/* $NetBSD: panel.c,v 1.2 2011/02/16 23:44:19 jmcneill Exp $ */
/*-
* Copyright (c) 2009 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.1 2009/05/14 01:10:19 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.2 2011/02/16 23:44:19 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,6 +71,11 @@
static int
panel_match(device_t parent, cfdata_t match, void *aux)
{
+ struct hpc_attach_args *ha = aux;
+
+ if (strcmp(ha->ha_name, match->cf_name) != 0)
+ return 0;
+
if (mach_type == MACH_SGI_IP22)
return 1;
Index: src/sys/arch/sgimips/hpc/pi1ppc.c
diff -u src/sys/arch/sgimips/hpc/pi1ppc.c:1.8 src/sys/arch/sgimips/hpc/pi1ppc.c:1.9
--- src/sys/arch/sgimips/hpc/pi1ppc.c:1.8 Tue Jan 25 12:21:04 2011
+++ src/sys/arch/sgimips/hpc/pi1ppc.c Wed Feb 16 23:44:20 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pi1ppc.c,v 1.8 2011/01/25 12:21:04 tsutsui Exp $ */
+/* $NetBSD: pi1ppc.c,v 1.9 2011/02/16 23:44:20 jmcneill Exp $ */
/*
* Copyright (c) 2001 Alcove - Nicolas Souchu
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pi1ppc.c,v 1.8 2011/01/25 12:21:04 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pi1ppc.c,v 1.9 2011/02/16 23:44:20 jmcneill Exp $");
#include "opt_pi1ppc.h"
@@ -162,6 +162,11 @@
static int
pi1ppc_match(device_t parent, cfdata_t match, void *aux)
{
+ struct hpc_attach_args *ha = aux;
+
+ if (strcmp(ha->ha_name, match->cf_name) != 0)
+ return 0;
+
if (mach_type == MACH_SGI_IP22)
return 1;