From 26ce4f0684ef4b96d0244ac58b89ec282d5b980c Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Fri, 16 May 2008 14:19:56 -0600 Subject: adb: BKL pushdown Put explicit lock_kernel() calls in adb_open(). The fact that adb_release() already has them suggests this is necessary. Signed-off-by: Jonathan Corbet --- drivers/macintosh/adb.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index dbaad39020a..40c70ba62bf 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -644,12 +644,18 @@ do_adb_query(struct adb_request *req) static int adb_open(struct inode *inode, struct file *file) { struct adbdev_state *state; + int ret = 0; - if (iminor(inode) > 0 || adb_controller == NULL) - return -ENXIO; + lock_kernel(); + if (iminor(inode) > 0 || adb_controller == NULL) { + ret = -ENXIO; + goto out; + } state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); - if (state == 0) - return -ENOMEM; + if (state == 0) { + ret = -ENOMEM; + goto out; + } file->private_data = state; spin_lock_init(&state->lock); atomic_set(&state->n_pending, 0); @@ -657,7 +663,9 @@ static int adb_open(struct inode *inode, struct file *file) init_waitqueue_head(&state->wait_queue); state->inuse = 1; - return 0; +out: + unlock_kernel(); + return ret; } static int adb_release(struct inode *inode, struct file *file) -- cgit v1.2.3 From b82829943c470e59cfd3ee84d8ed6ae5d5e1a55b Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:15:32 +0200 Subject: ans-lcd: BKL pushdown Signed-off-by: Arnd Bergmann --- drivers/macintosh/ans-lcd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c index 73c50bc0209..6a822189325 100644 --- a/drivers/macintosh/ans-lcd.c +++ b/drivers/macintosh/ans-lcd.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include @@ -119,6 +120,7 @@ anslcd_ioctl( struct inode * inode, struct file * file, static int anslcd_open( struct inode * inode, struct file * file ) { + cycle_kernel_lock(); return 0; } -- cgit v1.2.3 From b9bde77a6a4f76b767d4363a5f74127528426159 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:16:11 +0200 Subject: macintosh-smu: BKL pushdown Signed-off-by: Arnd Bergmann --- drivers/macintosh/smu.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 77ad192962c..b82fcd210bf 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -19,6 +19,7 @@ * the userland interface */ +#include #include #include #include @@ -1083,10 +1084,12 @@ static int smu_open(struct inode *inode, struct file *file) pp->mode = smu_file_commands; init_waitqueue_head(&pp->wait); + lock_kernel(); spin_lock_irqsave(&smu_clist_lock, flags); list_add(&pp->list, &smu_clist); spin_unlock_irqrestore(&smu_clist_lock, flags); file->private_data = pp; + unlock_kernel(); return 0; } -- cgit v1.2.3 From ffe83733b88655b643e9d4ad0dda5ef9584d5926 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 20 May 2008 19:16:58 +0200 Subject: via-pmu: BKL pushdown Signed-off-by: Arnd Bergmann --- drivers/macintosh/via-pmu.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/macintosh') diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index d6365a9f063..d524dc245a2 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -18,6 +18,7 @@ * */ #include +#include #include #include #include @@ -2047,6 +2048,7 @@ pmu_open(struct inode *inode, struct file *file) pp->rb_get = pp->rb_put = 0; spin_lock_init(&pp->lock); init_waitqueue_head(&pp->wait); + lock_kernel(); spin_lock_irqsave(&all_pvt_lock, flags); #if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) pp->backlight_locker = 0; @@ -2054,6 +2056,7 @@ pmu_open(struct inode *inode, struct file *file) list_add(&pp->list, &all_pmu_pvt); spin_unlock_irqrestore(&all_pvt_lock, flags); file->private_data = pp; + unlock_kernel(); return 0; } -- cgit v1.2.3