diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-05 15:03:03 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-05 15:03:03 +0000 |
commit | ef9a3a6ee6feb7d57700d5587d38c1b29a886a10 (patch) | |
tree | cc945839eb7c017fbc2ae70041dfe4b011edcde2 /sys/dev/usb/hid.c | |
parent | 3186e506b5f134cd7d50cff931d6d7e4803a6ccd (diff) |
hid_locate() is supposed to accept the last two arguments being NULL, so
correctly handle this in the failure case.
Diffstat (limited to 'sys/dev/usb/hid.c')
-rw-r--r-- | sys/dev/usb/hid.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c index db46c714544..3e9df98fe29 100644 --- a/sys/dev/usb/hid.c +++ b/sys/dev/usb/hid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hid.c,v 1.22 2009/07/24 08:37:47 jsg Exp $ */ +/* $OpenBSD: hid.c,v 1.23 2011/04/05 15:03:02 miod Exp $ */ /* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */ @@ -421,7 +421,8 @@ hid_locate(void *desc, int size, u_int32_t u, u_int8_t id, enum hid_kind k, } } hid_end_parse(d); - loc->size = 0; + if (loc != NULL) + loc->size = 0; return (0); } |