aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/i2o_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/i2o/i2o_config.c')
-rw-r--r--drivers/message/i2o/i2o_config.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index c0fb77dc19bb..4238de98d4a6 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -1061,6 +1061,7 @@ static int cfg_open(struct inode *inode, struct file *file)
1061 if (!tmp) 1061 if (!tmp)
1062 return -ENOMEM; 1062 return -ENOMEM;
1063 1063
1064 lock_kernel();
1064 file->private_data = (void *)(i2o_cfg_info_id++); 1065 file->private_data = (void *)(i2o_cfg_info_id++);
1065 tmp->fp = file; 1066 tmp->fp = file;
1066 tmp->fasync = NULL; 1067 tmp->fasync = NULL;
@@ -1074,6 +1075,7 @@ static int cfg_open(struct inode *inode, struct file *file)
1074 spin_lock_irqsave(&i2o_config_lock, flags); 1075 spin_lock_irqsave(&i2o_config_lock, flags);
1075 open_files = tmp; 1076 open_files = tmp;
1076 spin_unlock_irqrestore(&i2o_config_lock, flags); 1077 spin_unlock_irqrestore(&i2o_config_lock, flags);
1078 unlock_kernel();
1077 1079
1078 return 0; 1080 return 0;
1079} 1081}
@@ -1082,15 +1084,17 @@ static int cfg_fasync(int fd, struct file *fp, int on)
1082{ 1084{
1083 ulong id = (ulong) fp->private_data; 1085 ulong id = (ulong) fp->private_data;
1084 struct i2o_cfg_info *p; 1086 struct i2o_cfg_info *p;
1087 int ret = -EBADF;
1085 1088
1089 lock_kernel();
1086 for (p = open_files; p; p = p->next) 1090 for (p = open_files; p; p = p->next)
1087 if (p->q_id == id) 1091 if (p->q_id == id)
1088 break; 1092 break;
1089 1093
1090 if (!p) 1094 if (p)
1091 return -EBADF; 1095 ret = fasync_helper(fd, fp, on, &p->fasync);
1092 1096 unlock_kernel();
1093 return fasync_helper(fd, fp, on, &p->fasync); 1097 return ret;
1094} 1098}
1095 1099
1096static int cfg_release(struct inode *inode, struct file *file) 1100static int cfg_release(struct inode *inode, struct file *file)