Hi all, Two small fixes in uvc_find_control() and uvc_ctrl_commit_entity() prevents kernel bug of NULL pointer usage. See my previous message concerning controls problem in Panasonic Camcorder NV-GS11 (04da:2318).
Patch attached. -- Regards, Serge A. Suchkov -- Fifth Law of Procrastination: Procrastination avoids boredom; one never has the feeling that there is nothing important to do.
diff -u -r -N trunk/uvc_ctrl.c Experimental/trunk/uvc_ctrl.c --- trunk/uvc_ctrl.c 2007-04-02 07:11:25.000000000 +0400 +++ Experimental/trunk/uvc_ctrl.c 2007-04-02 07:24:00.000000000 +0400 @@ -447,7 +447,8 @@ struct uvc_control_mapping *map; unsigned int i; - for (i = 0; i < entity->ncontrols; ++i) { + if(entity) + for (i = 0; i < entity->ncontrols; ++i) { ctrl = &entity->controls[i]; if (ctrl->info == NULL) continue; @@ -458,7 +459,7 @@ return ctrl; } } - } + } return NULL; } @@ -593,7 +594,8 @@ unsigned int i; int ret; - for (i = 0; i < entity->ncontrols; ++i) { + if(entity) + for (i = 0; i < entity->ncontrols; ++i) { ctrl = &entity->controls[i]; if (ctrl->info == NULL || !ctrl->dirty) continue; @@ -618,7 +620,7 @@ if (ret < 0) return ret; - } + } return 0; }
_______________________________________________ Linux-uvc-devel mailing list Linux-uvc-devel@lists.berlios.de https://lists.berlios.de/mailman/listinfo/linux-uvc-devel