aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/soc_camera/mt9v022.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-11-28 21:56:15 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-04 22:34:59 -0500
commitdaf16bab1eaf5a82217697bfb91eb7d9c9745d0d (patch)
treee811da4987a71d741c45fef284a28f61e946d823 /drivers/media/i2c/soc_camera/mt9v022.c
parent3a799c27b3faebaf5a7a6149dfe8f705451b241f (diff)
[media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()
The dereference to 'icl' should be moved below the NULL test. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/i2c/soc_camera/mt9v022.c')
-rw-r--r--drivers/media/i2c/soc_camera/mt9v022.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/i2c/soc_camera/mt9v022.c b/drivers/media/i2c/soc_camera/mt9v022.c
index d40a8858be01..75098024d477 100644
--- a/drivers/media/i2c/soc_camera/mt9v022.c
+++ b/drivers/media/i2c/soc_camera/mt9v022.c
@@ -875,7 +875,7 @@ static int mt9v022_probe(struct i2c_client *client,
875 struct mt9v022 *mt9v022; 875 struct mt9v022 *mt9v022;
876 struct soc_camera_link *icl = soc_camera_i2c_to_link(client); 876 struct soc_camera_link *icl = soc_camera_i2c_to_link(client);
877 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); 877 struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
878 struct mt9v022_platform_data *pdata = icl->priv; 878 struct mt9v022_platform_data *pdata;
879 int ret; 879 int ret;
880 880
881 if (!icl) { 881 if (!icl) {
@@ -893,6 +893,7 @@ static int mt9v022_probe(struct i2c_client *client,
893 if (!mt9v022) 893 if (!mt9v022)
894 return -ENOMEM; 894 return -ENOMEM;
895 895
896 pdata = icl->priv;
896 v4l2_i2c_subdev_init(&mt9v022->subdev, client, &mt9v022_subdev_ops); 897 v4l2_i2c_subdev_init(&mt9v022->subdev, client, &mt9v022_subdev_ops);
897 v4l2_ctrl_handler_init(&mt9v022->hdl, 6); 898 v4l2_ctrl_handler_init(&mt9v022->hdl, 6);
898 v4l2_ctrl_new_std(&mt9v022->hdl, &mt9v022_ctrl_ops, 899 v4l2_ctrl_new_std(&mt9v022->hdl, &mt9v022_ctrl_ops,