From: Jonathan Corbet Date: Thu, 15 May 2008 16:03:09 +0000 (-0600) Subject: AoE: cdev lock_kernel() pushdown X-Git-Tag: v2.6.27-rc1~1103^2~136 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=579174a55f491edeaccb8f5d3dc7ad69a17f5423;p=linux-2.6 AoE: cdev lock_kernel() pushdown Signed-off-by: Jonathan Corbet --- diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index e8e60e7a2e..d1de68a319 100644 --- a/drivers/block/aoe/aoechr.c +++ b/drivers/block/aoe/aoechr.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "aoe.h" enum { @@ -174,12 +175,16 @@ aoechr_open(struct inode *inode, struct file *filp) { int n, i; + lock_kernel(); n = iminor(inode); filp->private_data = (void *) (unsigned long) n; for (i = 0; i < ARRAY_SIZE(chardevs); ++i) - if (chardevs[i].minor == n) + if (chardevs[i].minor == n) { + unlock_kernel(); return 0; + } + unlock_kernel(); return -EINVAL; }