diff options
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index a3fabdbe6ca6..f3384c32b9a1 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -1097,28 +1097,17 @@ static int cfg_fasync(int fd, struct file *fp, int on) | |||
1097 | static int cfg_release(struct inode *inode, struct file *file) | 1097 | static int cfg_release(struct inode *inode, struct file *file) |
1098 | { | 1098 | { |
1099 | ulong id = (ulong) file->private_data; | 1099 | ulong id = (ulong) file->private_data; |
1100 | struct i2o_cfg_info *p1, *p2; | 1100 | struct i2o_cfg_info *p, **q; |
1101 | unsigned long flags; | 1101 | unsigned long flags; |
1102 | 1102 | ||
1103 | lock_kernel(); | 1103 | lock_kernel(); |
1104 | p1 = p2 = NULL; | ||
1105 | |||
1106 | spin_lock_irqsave(&i2o_config_lock, flags); | 1104 | spin_lock_irqsave(&i2o_config_lock, flags); |
1107 | for (p1 = open_files; p1;) { | 1105 | for (q = &open_files; (p = *q) != NULL; q = &p->next) { |
1108 | if (p1->q_id == id) { | 1106 | if (p->q_id == id) { |
1109 | 1107 | *q = p->next; | |
1110 | if (p1->fasync) | 1108 | kfree(p); |
1111 | cfg_fasync(-1, file, 0); | ||
1112 | if (p2) | ||
1113 | p2->next = p1->next; | ||
1114 | else | ||
1115 | open_files = p1->next; | ||
1116 | |||
1117 | kfree(p1); | ||
1118 | break; | 1109 | break; |
1119 | } | 1110 | } |
1120 | p2 = p1; | ||
1121 | p1 = p1->next; | ||
1122 | } | 1111 | } |
1123 | spin_unlock_irqrestore(&i2o_config_lock, flags); | 1112 | spin_unlock_irqrestore(&i2o_config_lock, flags); |
1124 | unlock_kernel(); | 1113 | unlock_kernel(); |