PERFORCE change 149823 for review

Hans Petter Selasky hselasky at FreeBSD.org
Mon Sep 15 20:39:10 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=149823

Change 149823 by hselasky at hselasky_laptop001 on 2008/09/15 20:39:06

	
	Make sure the real access information is returned 
	and not the effective access information.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#33 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#33 (text+ko) ====

@@ -351,7 +351,6 @@
 	    (pdst->iface_index >= USB_IFACE_MAX)) {
 		return (EINVAL);
 	}
-retry:
 	if (level == 1)
 		devloc = USB_BUS_MAX;	/* use root-HUB to access bus */
 	else
@@ -403,21 +402,18 @@
 		pdst->user_id = psrc->uid;
 		pdst->group_id = psrc->gid;
 		pdst->mode = psrc->mode;
-		error = 0;
 	} else {
-		error = EINVAL;
+		/* access entry at this level and location is not active */
+		pdst->user_id = 0;
+		pdst->group_id = 0;
+		pdst->mode = 0;
 	}
 	mtx_unlock(&usb2_ref_lock);
 
 	if ((level > 0) && (level < 4)) {
 		usb2_unref_device(&loc);
-		if (error) {
-			/* try to find the permission one level down */
-			level--;
-			goto retry;
-		}
 	}
-	return (error);
+	return (0);
 }
 
 /*------------------------------------------------------------------------*


More information about the p4-projects mailing list