X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Fbriq_panel.c;h=d8cff909001c1e4cbd68c8aa22f08eb70d08bbdb;hb=9fec6060d9e48ed7db0dac0e16d0f0f0e615b7f6;hp=b6f2639f903d344754f211f12e7e630759e2861a;hpb=39fe5434cb9de5da40510028b17b96bc4eb312b3;p=linux-2.6 diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c index b6f2639f90..d8cff90900 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; }