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

genrtc: BKL pushdown

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Arnd Bergmann and committed by
Jonathan Corbet
742a2fe3 78abb6ac

+6 -1
+6 -1
drivers/char/genrtc.c
··· 51 51 #include <linux/init.h> 52 52 #include <linux/poll.h> 53 53 #include <linux/proc_fs.h> 54 + #include <linux/smp_lock.h> 54 55 #include <linux/workqueue.h> 55 56 56 57 #include <asm/uaccess.h> ··· 339 338 340 339 static int gen_rtc_open(struct inode *inode, struct file *file) 341 340 { 342 - if (gen_rtc_status & RTC_IS_OPEN) 341 + lock_kernel(); 342 + if (gen_rtc_status & RTC_IS_OPEN) { 343 + unlock_kernel(); 343 344 return -EBUSY; 345 + } 344 346 345 347 gen_rtc_status |= RTC_IS_OPEN; 346 348 gen_rtc_irq_data = 0; 347 349 irq_active = 0; 350 + unlock_kernel(); 348 351 349 352 return 0; 350 353 }