X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fflash.c;h=7d95e151513a0a5446e07ef6da24d9605334af53;hb=04489eeb02a40bc15029886cef7285ada3ab0de6;hp=262f01e68592f4b359cef0d7c0743673cb237049;hpb=805f53f085346b6765eda02820721a14ce0d644f;p=linux-2.6 diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 262f01e685..7d95e15151 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -126,9 +127,13 @@ flash_read(struct file * file, char __user * buf, static int flash_open(struct inode *inode, struct file *file) { - if (test_and_set_bit(0, (void *)&flash.busy) != 0) + lock_kernel(); + if (test_and_set_bit(0, (void *)&flash.busy) != 0) { + unlock_kernel(); return -EBUSY; + } + unlock_kernel(); return 0; }