From: Jonathan Corbet Date: Fri, 16 May 2008 19:57:31 +0000 (-0600) Subject: dsp56k: BKL pushdown X-Git-Tag: v2.6.27-rc1~1103^2~102 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65f37b790bd7ba15413838579470296a709c45e6;p=linux-2.6 dsp56k: BKL pushdown Put explicit lock_kernel calls into dsp56k_open(). [Stupid missing label error fixed] Signed-off-by: Jonathan Corbet --- diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index a69c652832..7bf7485377 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -436,13 +437,17 @@ static unsigned int dsp56k_poll(struct file *file, poll_table *wait) static int dsp56k_open(struct inode *inode, struct file *file) { int dev = iminor(inode) & 0x0f; + int ret = 0; + lock_kernel(); switch(dev) { case DSP56K_DEV_56001: - if (test_and_set_bit(0, &dsp56k.in_use)) - return -EBUSY; + if (test_and_set_bit(0, &dsp56k.in_use)) { + ret = -EBUSY; + goto out; + } dsp56k.timeout = TIMEOUT; dsp56k.maxio = MAXIO; @@ -458,10 +463,11 @@ static int dsp56k_open(struct inode *inode, struct file *file) break; default: - return -ENODEV; + ret = -ENODEV; } - - return 0; +out: + unlock_kernel(); + return ret; } static int dsp56k_release(struct inode *inode, struct file *file)