X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fflash.c;h=7d95e151513a0a5446e07ef6da24d9605334af53;hb=78abb6ac919cee123e632d833a42d0312ccb2b0d;hp=44e039865aa99714d4184e033a2d5bce65d94532;hpb=51d7cfc670e4c09e296af101326a6270060e72e7;p=linux-2.6 diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 44e039865a..7d95e15151 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -127,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; }