[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1653897481-25681-1-git-send-email-baihaowen@meizu.com>
Date: Mon, 30 May 2022 15:58:01 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Haowen Bai <baihaowen@...zu.com>, <linux-media@...r.kernel.org>,
<linux-staging@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] media: atomisp-mt9m114: Fix pointer dereferenced before checking
The info->data is dereferencing before null checking, so move
it after checking.
Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
index 00d6842c07d6..3c81ab73cdae 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
@@ -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)
--
2.7.4
Powered by blists - more mailing lists