diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-10-26 20:17:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-10-26 20:17:28 +0000 |
commit | c16d88bf4bfc8e8526f12a85971a6f35865648c5 (patch) | |
tree | 195dce594f943b0bd5fcf3230f02adb820deba01 /sys/arch/sparc64 | |
parent | a9810f2e4406559596eb8337a7a35f248cdbb080 (diff) |
Do not do strncmp comparisons on dv_xname because longer device names which
look similar could arrive in the future. Instead, compare directly against
dv_cfdata->cf_driver->cd_name
Issue originally spotted by miod
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c index 5d9457c57b1..ce987d10979 100644 --- a/sys/arch/sparc64/sparc64/cpu.c +++ b/sys/arch/sparc64/sparc64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.52 2009/04/13 08:31:36 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.53 2009/10/26 20:17:25 deraadt Exp $ */ /* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */ /* @@ -260,7 +260,7 @@ cpu_attach(parent, dev, aux) vers = IU_VERS(ver); /* tell them what we have */ - if (strncmp(parent->dv_xname, "core", 4) == 0) + if (strcmp(parent->dv_cfdata->cf_driver->cd_name, "core") == 0) node = OF_parent(ma->ma_node); else node = ma->ma_node; |