Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2010 17:27:55 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 173522 for review
Message-ID:  <201001221727.o0MHRtoI087579@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=173522

Change 173522 by hselasky@hselasky_laptop001 on 2010/01/22 17:27:00

	USB quirks:
		- add missing NULL pointer check.
		- fixes some panics.
		- patch by HPS

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/quirk/usb_quirk.c#18 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/quirk/usb_quirk.c#18 (text+ko) ====

@@ -681,6 +681,8 @@
 		mtx_lock(&usb_quirk_mtx);
 		pqe = usb_quirk_get_entry(pgq->vid, pgq->pid,
 		    pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 1);
+		if (pqe == NULL)
+			return (EINVAL);
 		for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) {
 			if (pqe->quirks[x] == UQ_NONE) {
 				pqe->quirks[x] = y;
@@ -715,6 +717,8 @@
 		mtx_lock(&usb_quirk_mtx);
 		pqe = usb_quirk_get_entry(pgq->vid, pgq->pid,
 		    pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 0);
+		if (pqe == NULL)
+			return (EINVAL);
 		for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) {
 			if (pqe->quirks[x] == y) {
 				pqe->quirks[x] = UQ_NONE;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001221727.o0MHRtoI087579>