Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d238885 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 4dbfd040
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -594,8 +594,11 @@ static int mt9t031_s_power(struct v4l2_subdev *sd, int on)
		ret = soc_camera_power_on(&client->dev, ssdd, mt9t031->clk);
		if (ret < 0)
			return ret;
		if (vdev)
			/* Not needed during probing, when vdev isn't available yet */
			vdev->dev.type = &mt9t031_dev_type;
	} else {
		if (vdev)
			vdev->dev.type = NULL;
		soc_camera_power_off(&client->dev, ssdd, mt9t031->clk);
	}