diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-01-14 14:56:22 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-01-17 13:23:16 +1000 |
commit | 010a281642b2a6d93b084c7c84fee3e43a39ea33 (patch) | |
tree | 28249bc7de37746ee651096d9c2c97c6f48211d3 /nvkm/subdev/therm | |
parent | 634af5583e12eae7e59b372e0360c39006c862c3 (diff) | |
download | nouveau-010a281642b2a6d93b084c7c84fee3e43a39ea33.tar.gz |
fix null ptr dereferences on some boards
Regression from "device: populate master subdev pointer only when fully
constructed"
Reported-by: Bob Gleitsmann <rjgleits@bellsouth.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm/subdev/therm')
-rw-r--r-- | nvkm/subdev/therm/ic.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nvkm/subdev/therm/ic.c b/nvkm/subdev/therm/ic.c index e44ed7b93..7610fc5f8 100644 --- a/nvkm/subdev/therm/ic.c +++ b/nvkm/subdev/therm/ic.c @@ -29,9 +29,9 @@ static bool probe_monitoring_device(struct nouveau_i2c_port *i2c, - struct i2c_board_info *info) + struct i2c_board_info *info, void *data) { - struct nouveau_therm_priv *priv = (void *)nouveau_therm(i2c); + struct nouveau_therm_priv *priv = data; struct nvbios_therm_sensor *sensor = &priv->bios_sensor; struct i2c_client *client; @@ -96,7 +96,7 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm) }; i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", - board, probe_monitoring_device); + board, probe_monitoring_device, therm); if (priv->ic) return; } @@ -108,7 +108,7 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm) }; i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", - board, probe_monitoring_device); + board, probe_monitoring_device, therm); if (priv->ic) return; } @@ -117,5 +117,5 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm) device. Let's try our static list. */ i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", - nv_board_infos, probe_monitoring_device); + nv_board_infos, probe_monitoring_device, therm); } |