From 3be8b37f5928ec0828259a16765ddc4bcebe6d89 Mon Sep 17 00:00:00 2001 From: Xu Hongfei Date: Thu, 6 Jun 2019 11:58:50 +0800 Subject: [PATCH] phy: phy-rockchip-mipi-rx: increase the check whether the sensor is null Change-Id: Ic80a97e5bf195ee236f7869755b88e825e57744e Signed-off-by: Xu Hongfei --- drivers/phy/rockchip/phy-rockchip-mipi-rx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-mipi-rx.c b/drivers/phy/rockchip/phy-rockchip-mipi-rx.c index 5b82a47676b8..5d9c45b338f8 100644 --- a/drivers/phy/rockchip/phy-rockchip-mipi-rx.c +++ b/drivers/phy/rockchip/phy-rockchip-mipi-rx.c @@ -728,8 +728,10 @@ static int mipidphy_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_subdev *sensor_sd = get_remote_sensor(sd); struct mipidphy_sensor *sensor = sd_to_sensor(priv, sensor_sd); - mipidphy_update_sensor_mbus(sd); - *config = sensor->mbus; + if (sensor_sd) { + mipidphy_update_sensor_mbus(sd); + *config = sensor->mbus; + } return 0; }