X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Fbriq_panel.c;h=d8cff909001c1e4cbd68c8aa22f08eb70d08bbdb;hb=acd15a836053ff6b48e78dc6de388b225ba9e40d;hp=b6f2639f903d344754f211f12e7e630759e2861a;hpb=ae6f4a8b986c9d9eff00fcbd23d1c2585b97fe57;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c index b6f2639f903..d8cff909001 100644 --- a/drivers/char/briq_panel.c +++ b/drivers/char/briq_panel.c @@ -6,6 +6,7 @@ #include +#include #include #include #include @@ -67,11 +68,15 @@ static void set_led(char state) static int briq_panel_open(struct inode *ino, struct file *filep) { - /* enforce single access */ - if (vfd_is_open) + lock_kernel(); + /* enforce single access, vfd_is_open is protected by BKL */ + if (vfd_is_open) { + unlock_kernel(); return -EBUSY; + } vfd_is_open = 1; + unlock_kernel(); return 0; }