[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1501192.nRtmsTZae5@vostro.rjw.lan>
Date: Wed, 03 Feb 2016 02:27:14 +0100
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Alexey Klimov <alexey.klimov@....com>
Cc: linux-acpi@...r.kernel.org, jassisinghbrar@...il.com,
sudeep.holla@....com, ashwin.chaugule@...aro.org,
pprakash@...eaurora.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] mailbox: pcc: fix channel calculation in get_pcc_channel()
On Tuesday, February 02, 2016 11:29:22 AM Alexey Klimov wrote:
> This patch fixes the calculation of pcc_chan for non-zero id.
> After the compiler ignores the (unsigned long) cast the
> pcc_mbox_channels pointer is type-cast and then the type-cast
> offset is added which results in address outside of the range
> leading to the kernel crashing.
>
> We might add braces and make it:
>
> pcc_chan = (struct mbox_chan *)
> ((unsigned long) pcc_mbox_channels +
> (id * sizeof(*pcc_chan)));
>
> but let's go with array approach here and use id as index.
>
> Tested on Juno board.
>
> Acked-by: Sudeep Holla <sudeep.holla@....com>
> Acked-by: Ashwin Chaugule <ashwin.chaugule@...aro.org>
> Signed-off-by: Alexey Klimov <alexey.klimov@....com>
Jassi said this was applied, so I'm not taking it.
Thanks,
Rafael
Powered by blists - more mailing lists