From: Dan Carpenter <dan.carpenter@oracle.com>
To: Haowen Bai <baihaowen@meizu.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: atomisp-mt9m114: Fix pointer dereferenced before checking
Date: Mon, 30 May 2022 12:25:20 +0300 [thread overview]
Message-ID: <20220530092520.GO2146@kadam> (raw)
In-Reply-To: <1653897481-25681-1-git-send-email-baihaowen@meizu.com>
On Mon, May 30, 2022 at 03:58:01PM +0800, Haowen Bai wrote:
> The info->data is dereferencing before null checking, so move
> it after checking.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.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;
This is not a dereference, it's just doing pointer math. Not a bug.
regards,
dan carpenter
next prev parent reply other threads:[~2022-05-30 9:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-30 7:58 [PATCH] media: atomisp-mt9m114: Fix pointer dereferenced before checking Haowen Bai
2022-05-30 9:25 ` Dan Carpenter [this message]
2022-05-30 11:22 ` Tommaso Merciai
2022-05-30 11:37 ` Tommaso Merciai
2022-05-31 1:41 ` baihaowen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220530092520.GO2146@kadam \
--to=dan.carpenter@oracle.com \
--cc=baihaowen@meizu.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox