[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 12 Dec 2016 18:48:53 +0800
From: Caesar Wang <sasukewxt@....com>
To: Eduardo Valentin <edubezval@...il.com>,
Caesar Wang <wxt@...k-chips.com>
Cc: heiko@...ech.de, linux-pm@...r.kernel.org,
briannorris@...omium.org, linux-kernel@...r.kernel.org,
smbarber@...omium.org, linux-rockchip@...ts.infradead.org,
rui.zhang@...el.com
Subject: Re: [PATCH v3 4/5] thermal: rockchip: optimize the conversion table
在 2016年11月30日 14:29, Eduardo Valentin 写道:
> Hey,
>
> On Mon, Nov 28, 2016 at 07:12:03PM +0800, Caesar Wang wrote:
>
> <cut>
>
>> + num = abs(table->id[mid].code - table->id[mid + 1].code);
>> + num *= temp - table->id[mid].temp;
>> + denom = table->id[mid + 1].temp - table->id[mid].temp;
>
> isn't the above 'mid + 1' off-by-one when mid ends being == table.length - 1?
>
> You would be accessing table->id[table.length], which is wrong memory
> access, no?
Yup, that's indeed a real issue for me.
FIxes on next version.
Thanks.
-Caesar
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
Powered by blists - more mailing lists