diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-07-15 20:19:14 +0100 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-07-15 20:19:14 +0100 |
commit | 0c17e4ceedd35c78b1c7413dbd16279a350be6bc (patch) | |
tree | 313b3b9ca04727f3704464e01d8dd97da1dd534b /drivers/s390/block/dasd_eer.c | |
parent | 19c1d6a34abf73d0baf8e325d018c920fa78dddc (diff) | |
parent | b9d2252c1e44fa83a4e65fdc9eb93db6297c55af (diff) | |
download | op-kernel-dev-0c17e4ceedd35c78b1c7413dbd16279a350be6bc.zip op-kernel-dev-0c17e4ceedd35c78b1c7413dbd16279a350be6bc.tar.gz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-rmk
Diffstat (limited to 'drivers/s390/block/dasd_eer.c')
-rw-r--r-- | drivers/s390/block/dasd_eer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index 6e53ab6..29da441 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c @@ -15,6 +15,7 @@ #include <linux/device.h> #include <linux/poll.h> #include <linux/mutex.h> +#include <linux/smp_lock.h> #include <asm/uaccess.h> #include <asm/atomic.h> @@ -525,6 +526,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) eerb = kzalloc(sizeof(struct eerbuffer), GFP_KERNEL); if (!eerb) return -ENOMEM; + lock_kernel(); eerb->buffer_page_count = eer_pages; if (eerb->buffer_page_count < 1 || eerb->buffer_page_count > INT_MAX / PAGE_SIZE) { @@ -532,6 +534,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) MESSAGE(KERN_WARNING, "can't open device since module " "parameter eer_pages is smaller then 1 or" " bigger then %d", (int)(INT_MAX / PAGE_SIZE)); + unlock_kernel(); return -EINVAL; } eerb->buffersize = eerb->buffer_page_count * PAGE_SIZE; @@ -539,12 +542,14 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) GFP_KERNEL); if (!eerb->buffer) { kfree(eerb); + unlock_kernel(); return -ENOMEM; } if (dasd_eer_allocate_buffer_pages(eerb->buffer, eerb->buffer_page_count)) { kfree(eerb->buffer); kfree(eerb); + unlock_kernel(); return -ENOMEM; } filp->private_data = eerb; @@ -552,6 +557,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) list_add(&eerb->list, &bufferlist); spin_unlock_irqrestore(&bufferlock, flags); + unlock_kernel(); return nonseekable_open(inp,filp); } |