PERFORCE change 173522 for review

Hans Petter Selasky hselasky at FreeBSD.org
Fri Jan 22 17:27:56 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=173522

Change 173522 by hselasky at 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;


More information about the p4-projects mailing list