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

rtc: at91sam9: Fix missing spin_lock_init()

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.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

authored by

Wei Yongjun and committed by
Alexandre Belloni
b7b17633 ae036af8

+1
+1
drivers/rtc/rtc-at91sam9.c
··· 375 375 if (!rtc) 376 376 return -ENOMEM; 377 377 378 + spin_lock_init(&rtc->lock); 378 379 rtc->irq = irq; 379 380 380 381 /* platform setup code should have handled this; sigh */