[media] rainshadow-cec: Fix missing spin_lock_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 25 Apr 2017 03:12:46 +0000 (00:12 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 18 May 2017 10:30:31 +0000 (07:30 -0300)
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: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI
CEC driver")

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/rainshadow-cec/rainshadow-cec.c

index 9ddd6a99f066bd557787af2e708ba413a6d920e5..8d3ca2c8b20fb43d8112b198b524cfce09be868e 100644 (file)
@@ -337,6 +337,7 @@ static int rain_connect(struct serio *serio, struct serio_driver *drv)
        serio_set_drvdata(serio, rain);
        INIT_WORK(&rain->work, rain_irq_work_handler);
        mutex_init(&rain->write_lock);
+       spin_lock_init(&rain->buf_lock);
 
        err = serio_open(serio, drv);
        if (err)