X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fflash.c;h=7d95e151513a0a5446e07ef6da24d9605334af53;hb=666484f0250db2e016948d63b3ef33e202e3b8d0;hp=44e039865aa99714d4184e033a2d5bce65d94532;hpb=e8b495fe09bc793ae26774e7b2667f7f658d56e2;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; }