From: Colin Ian King <colin.king@canonical.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Vinod Koul <vinod.koul@intel.com>,
Jeeja KP <jeeja.kp@intel.com>,
Jayachandran B <jayachandran.b@intel.com>,
"Subhransu S . Prusty" <subhransu.s.prusty@intel.com>,
Dharageswari R <dharageswari.r@intel.com>,
Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>,
Yong Zhi <yong.zhi@intel.com>,
alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: Intel: Skylake: fix dereference before NULL check on ebus
Date: Wed, 19 Apr 2017 14:34:33 +0100 [thread overview]
Message-ID: <fa93c146-cb7b-cefa-75d3-6507c63200c5@canonical.com> (raw)
In-Reply-To: <20170419133249.ac3sdmn7kqjbxaii@mwanda>
On 19/04/17 14:32, Dan Carpenter wrote:
> On Wed, Apr 19, 2017 at 01:16:13PM +0100, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> ebus is being NULL checked however it is being dereferenced
>> earlier on the assignment bus = ebus_to_hbus(ebus). Fix this
>> by moving the assignment to after the NULL check on ebus to
>> avoid a NULL pointer dereference error.
>>
>
> ebus_to_hbus() doesn't dereference "ebus" it just uses it for pointer
> math.
>
> #define ebus_to_hbus(ebus) (&(ebus)->bus)
>
> If you pass a NULL to there, it returns an offset starting from NULL but
> it doesn't Oops.
Doh, brown paper bag moment for me.
>
> regards,
> dan carpenter
>
>
prev parent reply other threads:[~2017-04-19 13:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 12:16 Colin King
2017-04-19 13:32 ` Dan Carpenter
2017-04-19 13:34 ` Colin Ian King [this message]
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=fa93c146-cb7b-cefa-75d3-6507c63200c5@canonical.com \
--to=colin.king@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=dharageswari.r@intel.com \
--cc=jayachandran.b@intel.com \
--cc=jeeja.kp@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pardha.saradhi.kesapragada@intel.com \
--cc=perex@perex.cz \
--cc=subhransu.s.prusty@intel.com \
--cc=tiwai@suse.com \
--cc=vinod.koul@intel.com \
--cc=yong.zhi@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
all inboxes | Powered by JetHome®