[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fa93c146-cb7b-cefa-75d3-6507c63200c5@canonical.com>
Date: Wed, 19 Apr 2017 14:34:33 +0100
From: Colin Ian King <colin.king@...onical.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Vinod Koul <vinod.koul@...el.com>,
Jeeja KP <jeeja.kp@...el.com>,
Jayachandran B <jayachandran.b@...el.com>,
"Subhransu S . Prusty" <subhransu.s.prusty@...el.com>,
Dharageswari R <dharageswari.r@...el.com>,
Pardha Saradhi K <pardha.saradhi.kesapragada@...el.com>,
Yong Zhi <yong.zhi@...el.com>, alsa-devel@...a-project.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: Intel: Skylake: fix dereference before NULL check
on ebus
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@...onical.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
>
>
Powered by blists - more mailing lists