lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dmaengine: qcom: fix gpi undefined behavior
On 03-01-21, 14:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> gcc points out an incorrect error handling loop:
>
> drivers/dma/qcom/gpi.c: In function 'gpi_ch_init':
> drivers/dma/qcom/gpi.c:1254:15: error: iteration 2 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
> 1254 | struct gpii *gpii = gchan->gpii;
> | ^~~~
> drivers/dma/qcom/gpi.c:1951:2: note: within this loop
> 1951 | for (i = i - 1; i >= 0; i++) {
> | ^~~
>
> Change the loop to correctly walk backwards through the
> initialized fields rather than off into the woods.

Applied, thanks

--
~Vinod

\
 
 \ /
  Last update: 2021-01-04 13:41    [W:0.171 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site