media: atomisp-mt9m114: Fix pointer dereferenced before checking
The info->data is dereferencing before null checking, so move it after checking. Link: https://lore.kernel.org/linux-media/1653897481-25681-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai <baihaowen@meizu.com> Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
09b204eb9d
commit
3823112381
@ -616,13 +616,15 @@ static int mt9m114_get_intg_factor(struct i2c_client *client,
|
||||
struct camera_mipi_info *info,
|
||||
const struct mt9m114_res_struct *res)
|
||||
{
|
||||
struct atomisp_sensor_mode_data *buf = &info->data;
|
||||
struct atomisp_sensor_mode_data *buf;
|
||||
u32 reg_val;
|
||||
int ret;
|
||||
|
||||
if (!info)
|
||||
return -EINVAL;
|
||||
|
||||
buf = &info->data;
|
||||
|
||||
ret = mt9m114_read_reg(client, MISENSOR_32BIT,
|
||||
REG_PIXEL_CLK, ®_val);
|
||||
if (ret)
|
||||
|
Loading…
x
Reference in New Issue
Block a user