Module Name:    src
Committed By:   martin
Date:           Fri Jan 23 16:29:37 UTC 2015

Modified Files:
        src/sys/external/bsd/vchiq/dist/interface/vchiq_arm [netbsd-7]:
            vchiq_arm.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #446):
        sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c: revision 
1.15
More count vs ret confusion. Need to send notification if count != 0.


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 \
    src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c
diff -u src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.13.2.1 src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.13.2.2
--- src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c:1.13.2.1	Mon Dec 29 16:25:28 2014
+++ src/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_arm.c	Fri Jan 23 16:29:36 2015
@@ -718,6 +718,7 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 
 	case VCHIQ_IOC_AWAIT_COMPLETION: {
 		VCHIQ_AWAIT_COMPLETION_T *pargs = arg;
+		int count = 0;
 
 		DEBUG_TRACE(AWAIT_COMPLETION_LINE);
 		if (!instance->connected) {
@@ -752,9 +753,8 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 
 		if (ret == 0) {
 			int msgbufcount = pargs->msgbufcount;
-			int count;
 
-			for (count = 0; count < pargs->count; count++) {
+			for (; count < pargs->count; count++) {
 				VCHIQ_COMPLETION_DATA_T *completion;
 				VCHIQ_SERVICE_T *service1;
 				USER_SERVICE_T *user_service;
@@ -847,7 +847,7 @@ vchiq_ioctl(struct file *fp, u_long cmd,
 			pargs->count = count;
 		}
 
-		if (ret != 0)
+		if (count != 0)
 			up(&instance->remove_event);
 		lmutex_unlock(&instance->completion_mutex);
 		DEBUG_TRACE(AWAIT_COMPLETION_LINE);

Reply via email to