Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1532995

Re: [PATCH v3 4/5] thermal: rockchip: optimize the conversion table

From Eduardo Valentin <edubezval@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 4/5] thermal: rockchip: optimize the conversion table
Date 2016-11-30 07:30 +0100
Message-ID <sJ6yZ-2x2-11@gated-at.bofh.it> (permalink)
References <sIs8y-1nY-5@gated-at.bofh.it> <sIs8y-1nY-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/5] thermal: fixes the rockchip thermal Caesar Wang <wxt@rock-chips.com> - 2016-11-28 12:20 +0100
  [PATCH v3 4/5] thermal: rockchip: optimize the conversion table Caesar Wang <wxt@rock-chips.com> - 2016-11-28 12:20 +0100
    Re: [PATCH v3 4/5] thermal: rockchip: optimize the conversion table Eduardo Valentin <edubezval@gmail.com> - 2016-11-29 02:50 +0100
    Re: [PATCH v3 4/5] thermal: rockchip: optimize the conversion table Eduardo Valentin <edubezval@gmail.com> - 2016-11-30 07:30 +0100
  [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Caesar Wang <wxt@rock-chips.com> - 2016-11-28 12:20 +0100
    Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Brian Norris <briannorris@chromium.org> - 2016-11-28 19:50 +0100
    Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Eduardo Valentin <edubezval@gmail.com> - 2016-11-29 02:50 +0100
      Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Brian Norris <briannorris@chromium.org> - 2016-11-29 23:00 +0100
        Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Eduardo Valentin <edubezval@gmail.com> - 2016-11-30 06:10 +0100
          Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Brian Norris <briannorris@chromium.org> - 2016-11-30 07:00 +0100
            Re: [PATCH v3 3/5] thermal: rockchip: fixes invalid temperature case Eduardo Valentin <edubezval@gmail.com> - 2016-11-30 07:30 +0100

csiph-web