diff options
Diffstat (limited to 'drivers/message/i2o/driver.c')
-rw-r--r-- | drivers/message/i2o/driver.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index bebdd509b5d8..393be8e2914c 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
@@ -180,7 +180,13 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m) | |||
180 | { | 180 | { |
181 | struct i2o_driver *drv; | 181 | struct i2o_driver *drv; |
182 | struct i2o_message __iomem *msg = i2o_msg_out_to_virt(c, m); | 182 | struct i2o_message __iomem *msg = i2o_msg_out_to_virt(c, m); |
183 | u32 context = readl(&msg->u.s.icntxt); | 183 | u32 context; |
184 | unsigned long flags; | ||
185 | |||
186 | if(unlikely(!msg)) | ||
187 | return -EIO; | ||
188 | |||
189 | context = readl(&msg->u.s.icntxt); | ||
184 | 190 | ||
185 | if (unlikely(context >= i2o_max_drivers)) { | 191 | if (unlikely(context >= i2o_max_drivers)) { |
186 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, | 192 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, |
@@ -188,9 +194,9 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m) | |||
188 | return -EIO; | 194 | return -EIO; |
189 | } | 195 | } |
190 | 196 | ||
191 | spin_lock(&i2o_drivers_lock); | 197 | spin_lock_irqsave(&i2o_drivers_lock, flags); |
192 | drv = i2o_drivers[context]; | 198 | drv = i2o_drivers[context]; |
193 | spin_unlock(&i2o_drivers_lock); | 199 | spin_unlock_irqrestore(&i2o_drivers_lock, flags); |
194 | 200 | ||
195 | if (unlikely(!drv)) { | 201 | if (unlikely(!drv)) { |
196 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, | 202 | osm_warn("%s: Spurious reply to unknown driver %d\n", c->name, |