aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:15:38 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:54 -0400
commit986837badea28a8d32864ced7cbc2fb80b9f7c91 (patch)
treebebb825f1d9908ce0b32044a7894ae4b22765a6b /drivers
parent9a8bd2f76cb78fd730337f1b3b9cbef101ce2dad (diff)
block-dasd_eer: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/block/dasd_eer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index 6e53ab606e97..29da4413ad43 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -15,6 +15,7 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/poll.h> 16#include <linux/poll.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/smp_lock.h>
18 19
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20#include <asm/atomic.h> 21#include <asm/atomic.h>
@@ -525,6 +526,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
525 eerb = kzalloc(sizeof(struct eerbuffer), GFP_KERNEL); 526 eerb = kzalloc(sizeof(struct eerbuffer), GFP_KERNEL);
526 if (!eerb) 527 if (!eerb)
527 return -ENOMEM; 528 return -ENOMEM;
529 lock_kernel();
528 eerb->buffer_page_count = eer_pages; 530 eerb->buffer_page_count = eer_pages;
529 if (eerb->buffer_page_count < 1 || 531 if (eerb->buffer_page_count < 1 ||
530 eerb->buffer_page_count > INT_MAX / PAGE_SIZE) { 532 eerb->buffer_page_count > INT_MAX / PAGE_SIZE) {
@@ -532,6 +534,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
532 MESSAGE(KERN_WARNING, "can't open device since module " 534 MESSAGE(KERN_WARNING, "can't open device since module "
533 "parameter eer_pages is smaller then 1 or" 535 "parameter eer_pages is smaller then 1 or"
534 " bigger then %d", (int)(INT_MAX / PAGE_SIZE)); 536 " bigger then %d", (int)(INT_MAX / PAGE_SIZE));
537 unlock_kernel();
535 return -EINVAL; 538 return -EINVAL;
536 } 539 }
537 eerb->buffersize = eerb->buffer_page_count * PAGE_SIZE; 540 eerb->buffersize = eerb->buffer_page_count * PAGE_SIZE;
@@ -539,12 +542,14 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
539 GFP_KERNEL); 542 GFP_KERNEL);
540 if (!eerb->buffer) { 543 if (!eerb->buffer) {
541 kfree(eerb); 544 kfree(eerb);
545 unlock_kernel();
542 return -ENOMEM; 546 return -ENOMEM;
543 } 547 }
544 if (dasd_eer_allocate_buffer_pages(eerb->buffer, 548 if (dasd_eer_allocate_buffer_pages(eerb->buffer,
545 eerb->buffer_page_count)) { 549 eerb->buffer_page_count)) {
546 kfree(eerb->buffer); 550 kfree(eerb->buffer);
547 kfree(eerb); 551 kfree(eerb);
552 unlock_kernel();
548 return -ENOMEM; 553 return -ENOMEM;
549 } 554 }
550 filp->private_data = eerb; 555 filp->private_data = eerb;
@@ -552,6 +557,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
552 list_add(&eerb->list, &bufferlist); 557 list_add(&eerb->list, &bufferlist);
553 spin_unlock_irqrestore(&bufferlock, flags); 558 spin_unlock_irqrestore(&bufferlock, flags);
554 559
560 unlock_kernel();
555 return nonseekable_open(inp,filp); 561 return nonseekable_open(inp,filp);
556} 562}
557 563