Re: [PATCH][V2] backlight: sky81452: insure while loop does not allow negative array indexing

From
Daniel Thompson <hidden>
Date
2020-02-28 16:46:01
Also in
dri-devel, kernel-janitors, lkml
Reply to
Colin Ian King, 2020-02-27
On Thu, Feb 27, 2020 at 03:10:43PM +0000, Colin Ian King wrote:
On 27/02/2020 11:46, Daniel Thompson wrote:
quoted
On Wed, Feb 26, 2020 at 07:58:26PM +0000, Colin King wrote:
quoted
From: Colin Ian King <redacted>

In the unlikely event that num_entry is zero, the while loop
pre-decrements num_entry to cause negative array indexing into the
array sources. Fix this by iterating only if num_entry >= 0.

Addresses-Coverity: ("Out-of-bounds read")
Fixes: f705806c9f35 ("backlight: Add support Skyworks SKY81452 backlight driver")
Signed-off-by: Colin Ian King <redacted>
---

V2: fix typo in commit subject line
Isn't the correct spelling "ensure"?
It is. V1 is correct after all. Doh.
It wasn't spelt "ensure" in v1... 


Daniel.
Thread (6 messages) 6 messages, 3 authors, last reply 2020-02-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help