Re: [PATCH] ASoC: Intel: Skylake: fix dereference before NULL check on ebus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 19, 2017 at 01:16:13PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> 
> 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.

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux