]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: platform: Fix missing spin_lock_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 17 Dec 2018 12:14:35 +0000 (07:14 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 7 Jan 2019 18:54:01 +0000 (13:54 -0500)
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/aspeed-video.c

index dfec813f50a9af492758279431d1e214d87c2688..692e08ef38c0e6598261c9975f7536ca013b7cba 100644 (file)
@@ -1661,6 +1661,7 @@ static int aspeed_video_probe(struct platform_device *pdev)
 
        video->frame_rate = 30;
        video->dev = &pdev->dev;
+       spin_lock_init(&video->lock);
        mutex_init(&video->video_lock);
        init_waitqueue_head(&video->wait);
        INIT_DELAYED_WORK(&video->res_work, aspeed_video_resolution_work);