From: mpi Date: Fri, 9 Jan 2015 12:09:51 +0000 (+0000) Subject: Correctly report memory allocation failure in uhidev_set_report_async(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7ff5ccdaae430ffa4ff47e08293d00217501d8c0;p=openbsd Correctly report memory allocation failure in uhidev_set_report_async(). --- 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); }