Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'v4l_for_linus' of git://linuxtv.org/mchehab/for_linus

* 'v4l_for_linus' of git://linuxtv.org/mchehab/for_linus:
[media] omap3isp: Fix build error in ispccdc.c
[media] uvcvideo: Fix crash when linking entities
[media] v4l: Make sure we hold a reference to the v4l2_device before using it
[media] v4l: Fix use-after-free case in v4l2_device_release
[media] uvcvideo: Set alternate setting 0 on resume if the bus has been reset
[media] OMAP_VOUT: Fix build break caused by update_mode removal in DSS2

+26 -17
-13
drivers/media/video/omap/omap_vout.c
··· 2194 2194 "'%s' Display already enabled\n", 2195 2195 def_display->name); 2196 2196 } 2197 - /* set the update mode */ 2198 - if (def_display->caps & 2199 - OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) { 2200 - if (dssdrv->enable_te) 2201 - dssdrv->enable_te(def_display, 0); 2202 - if (dssdrv->set_update_mode) 2203 - dssdrv->set_update_mode(def_display, 2204 - OMAP_DSS_UPDATE_MANUAL); 2205 - } else { 2206 - if (dssdrv->set_update_mode) 2207 - dssdrv->set_update_mode(def_display, 2208 - OMAP_DSS_UPDATE_AUTO); 2209 - } 2210 2197 } 2211 2198 } 2212 2199
+1
drivers/media/video/omap3isp/ispccdc.c
··· 31 31 #include <linux/dma-mapping.h> 32 32 #include <linux/mm.h> 33 33 #include <linux/sched.h> 34 + #include <linux/slab.h> 34 35 #include <media/v4l2-event.h> 35 36 36 37 #include "isp.h"
+1 -1
drivers/media/video/uvc/uvc_driver.c
··· 1961 1961 1962 1962 list_for_each_entry(stream, &dev->streams, list) { 1963 1963 if (stream->intf == intf) 1964 - return uvc_video_resume(stream); 1964 + return uvc_video_resume(stream, reset); 1965 1965 } 1966 1966 1967 1967 uvc_trace(UVC_TRACE_SUSPEND, "Resume: video streaming USB interface "
+1 -1
drivers/media/video/uvc/uvc_entity.c
··· 49 49 if (remote == NULL) 50 50 return -EINVAL; 51 51 52 - source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING) 52 + source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING) 53 53 ? (remote->vdev ? &remote->vdev->entity : NULL) 54 54 : &remote->subdev.entity; 55 55 if (source == NULL)
+9 -1
drivers/media/video/uvc/uvc_video.c
··· 1104 1104 * buffers, making sure userspace applications are notified of the problem 1105 1105 * instead of waiting forever. 1106 1106 */ 1107 - int uvc_video_resume(struct uvc_streaming *stream) 1107 + int uvc_video_resume(struct uvc_streaming *stream, int reset) 1108 1108 { 1109 1109 int ret; 1110 + 1111 + /* If the bus has been reset on resume, set the alternate setting to 0. 1112 + * This should be the default value, but some devices crash or otherwise 1113 + * misbehave if they don't receive a SET_INTERFACE request before any 1114 + * other video control request. 1115 + */ 1116 + if (reset) 1117 + usb_set_interface(stream->dev->udev, stream->intfnum, 0); 1110 1118 1111 1119 stream->frozen = 0; 1112 1120
+1 -1
drivers/media/video/uvc/uvcvideo.h
··· 638 638 /* Video */ 639 639 extern int uvc_video_init(struct uvc_streaming *stream); 640 640 extern int uvc_video_suspend(struct uvc_streaming *stream); 641 - extern int uvc_video_resume(struct uvc_streaming *stream); 641 + extern int uvc_video_resume(struct uvc_streaming *stream, int reset); 642 642 extern int uvc_video_enable(struct uvc_streaming *stream, int enable); 643 643 extern int uvc_probe_video(struct uvc_streaming *stream, 644 644 struct uvc_streaming_control *probe);
+11
drivers/media/video/v4l2-dev.c
··· 173 173 media_device_unregister_entity(&vdev->entity); 174 174 #endif 175 175 176 + /* Do not call v4l2_device_put if there is no release callback set. 177 + * Drivers that have no v4l2_device release callback might free the 178 + * v4l2_dev instance in the video_device release callback below, so we 179 + * must perform this check here. 180 + * 181 + * TODO: In the long run all drivers that use v4l2_device should use the 182 + * v4l2_device release callback. This check will then be unnecessary. 183 + */ 184 + if (v4l2_dev->release == NULL) 185 + v4l2_dev = NULL; 186 + 176 187 /* Release video_device and perform other 177 188 cleanups as needed. */ 178 189 vdev->release(vdev);
+2
drivers/media/video/v4l2-device.c
··· 38 38 mutex_init(&v4l2_dev->ioctl_lock); 39 39 v4l2_prio_init(&v4l2_dev->prio); 40 40 kref_init(&v4l2_dev->ref); 41 + get_device(dev); 41 42 v4l2_dev->dev = dev; 42 43 if (dev == NULL) { 43 44 /* If dev == NULL, then name must be filled in by the caller */ ··· 94 93 95 94 if (dev_get_drvdata(v4l2_dev->dev) == v4l2_dev) 96 95 dev_set_drvdata(v4l2_dev->dev, NULL); 96 + put_device(v4l2_dev->dev); 97 97 v4l2_dev->dev = NULL; 98 98 } 99 99 EXPORT_SYMBOL_GPL(v4l2_device_disconnect);