From 26e68c677f6a2c5e8e4e2ab1427d4ffe57f625fc Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Fri, 9 Jan 2015 12:09:52 +0000 Subject: Correctly report memory allocation failure in uhidev_set_report_async(). --- sys/dev/usb/uhidev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 777218c5fd8..46ca3e52b02 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.67 2015/01/09 12:07:50 mpi Exp $ */ +/* $OpenBSD: uhidev.c,v 1.68 2015/01/09 12:09:51 mpi Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -680,7 +680,7 @@ uhidev_set_report_async(struct uhidev_softc *sc, int type, int id, void *data, len++; buf = malloc(len, M_TEMP, M_NOWAIT); if (buf == NULL) - return (USBD_NOMEM); + return (-1); buf[0] = id; memcpy(buf + 1, data, len - 1); } -- cgit v1.2.3