瀏覽代碼

msm: camera: sensor: Fix null ptr deference issue in eeprom driver

Fix subdev struct initialization in eeprom driver's component unbind
to avoid null pointer dereference in the I2C driver.

Change-Id: Idff09fb2b20fd35ffe75a29996ddc427eff2d3e5
CRs-Fixed: 3318035
Signed-off-by: Shravan Nevatia <[email protected]>
Shravan Nevatia 2 年之前
父節點
當前提交
b221d7b528
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c

+ 1 - 1
drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c

@@ -273,7 +273,7 @@ static void cam_eeprom_i2c_component_unbind(struct device *dev,
 {
 	int                             i;
 	struct i2c_client              *client = NULL;
-	struct v4l2_subdev             *sd = i2c_get_clientdata(client);
+	struct v4l2_subdev             *sd = NULL;
 	struct cam_eeprom_ctrl_t       *e_ctrl;
 	struct cam_eeprom_soc_private  *soc_private;
 	struct cam_hw_soc_info         *soc_info;