diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-06-25 18:08:54 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-06-25 18:08:54 +0000 |
commit | cd4174344ae062f65facd4c3785d6ad1ec224ec2 (patch) | |
tree | 5610de3c1bde6bf81bea4a34211b6b1108749cc3 /sys/arch/macppc/pci | |
parent | 7bad8a29cd5d91735bcc553d9b2df90eb3e5d654 (diff) |
OF_getprop() returns an int, so comparing its return value against sizeof casts
it to unsigned, and we need to also check for negative values.
All users of OF_getprop() did this but that one.
ok mpi@
Diffstat (limited to 'sys/arch/macppc/pci')
-rw-r--r-- | sys/arch/macppc/pci/ht.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/macppc/pci/ht.c b/sys/arch/macppc/pci/ht.c index 38e6012e929..996e51d040d 100644 --- a/sys/arch/macppc/pci/ht.c +++ b/sys/arch/macppc/pci/ht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ht.c,v 1.16 2013/08/07 07:29:19 mpi Exp $ */ +/* $OpenBSD: ht.c,v 1.17 2015/06/25 18:08:53 miod Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -84,7 +84,7 @@ ht_attach(struct device *parent, struct device *self, void *aux) } len = OF_getprop(ca->ca_node, "reg", regs, sizeof(regs)); - if (len < sizeof(regs)) { + if (len < 0 || len < sizeof(regs)) { printf(": regs lookup failed, node %x\n", ca->ca_node); return; } |