From: Corentin LABBE <clabbe.montjoie@gmail.com>
To: Felipe Balbi <balbi@ti.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: phy: msm: fix a possible NULL dereference
Date: Mon, 16 Nov 2015 20:18:38 +0100 [thread overview]
Message-ID: <564A2C0E.70305@gmail.com> (raw)
In-Reply-To: <87lh9xna93.fsf@saruman.tx.rr.com>
Le 16/11/2015 18:07, Felipe Balbi a écrit :
>
> Hi,
>
> LABBE Corentin <clabbe.montjoie@gmail.com> writes:
>> of_match_device could return NULL, and so cause a NULL pointer
>> dereference later. Renaming id to of_id (like all others do) in the
>> process.
>>
>> Reported-by: coverity (CID 1324133)
>> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
>> ---
>> drivers/usb/phy/phy-msm-usb.c | 9 ++++++---
>> 1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
>> index 80eb991..c4a66cf 100644
>> --- a/drivers/usb/phy/phy-msm-usb.c
>> +++ b/drivers/usb/phy/phy-msm-usb.c
>> @@ -1506,20 +1506,23 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
>> {
>> struct msm_otg_platform_data *pdata;
>> struct extcon_dev *ext_id, *ext_vbus;
>> - const struct of_device_id *id;
>> + const struct of_device_id *of_id;
>
> and why did you need to rename this variable ? Please resend without the
> variable rename.
>
I was renaming because all other drivers call it of_id, but I got hint from another thread to use of_device_get_match_data() which will permit to remove that variable, and still solve the issue.
Regards
next prev parent reply other threads:[~2015-11-16 19:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 7:45 [PATCH] usb: phy: msm: fix a possible NULL dereference LABBE Corentin
2015-11-16 17:07 ` Felipe Balbi
2015-11-16 19:18 ` Corentin LABBE [this message]
2015-11-16 19:23 ` Felipe Balbi
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=564A2C0E.70305@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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