aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-07-30 02:34:06 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-18 08:07:02 -0400
commit3d238885dbfd5359cd0c12fad858e8638f17bfc6 (patch)
tree33a95a6b25e1baf40d93390889acdd3ac1288b68 /drivers/media/i2c
parent4dbfd040757b8bf22f4ac17e80b39c068061a16c (diff)
[media] V4L2: mt9t031: don't Oops if asynchronous probing is attempted
The mt9t031 driver hasn't yet been updated to support asynchronous subdevice probing. If such a probing is attempted, the driver is allowed to fail, but it shouldn't Oops. This patch fixes such a potential NULL pointer dereference. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/soc_camera/mt9t031.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/i2c/soc_camera/mt9t031.c b/drivers/media/i2c/soc_camera/mt9t031.c
index 47d18d0bafe7..ee7bb0ffcecb 100644
--- a/drivers/media/i2c/soc_camera/mt9t031.c
+++ b/drivers/media/i2c/soc_camera/mt9t031.c
@@ -594,9 +594,12 @@ static int mt9t031_s_power(struct v4l2_subdev *sd, int on)
594 ret = soc_camera_power_on(&client->dev, ssdd, mt9t031->clk); 594 ret = soc_camera_power_on(&client->dev, ssdd, mt9t031->clk);
595 if (ret < 0) 595 if (ret < 0)
596 return ret; 596 return ret;
597 vdev->dev.type = &mt9t031_dev_type; 597 if (vdev)
598 /* Not needed during probing, when vdev isn't available yet */
599 vdev->dev.type = &mt9t031_dev_type;
598 } else { 600 } else {
599 vdev->dev.type = NULL; 601 if (vdev)
602 vdev->dev.type = NULL;
600 soc_camera_power_off(&client->dev, ssdd, mt9t031->clk); 603 soc_camera_power_off(&client->dev, ssdd, mt9t031->clk);
601 } 604 }
602 605