lkml.org 
[lkml]   [2016]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] edma: avoid uninitialized variable use
On Fri, Sep 30, 2016 at 06:19:01PM +0200, Arnd Bergmann wrote:
> If edma_read_slot() gets an invalid argument, it does not set a result,
> as found by "gcc -Wmaybe-uninitialized"
>
> drivers/dma/edma.c: In function 'dma_ccerr_handler':
> drivers/dma/edma.c:1499:21: error: 'p.a_b_cnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/dma/edma.c:1499:21: error: 'p.ccnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> if (p.a_b_cnt == 0 && p.ccnt == 0) {
>
> If we change the function to return an error in this case, we can handle
> the failure more gracefully and treat this the same way as a null slot
> that we already catch.

Applied. Fixes subsystem tag

Thanks
--
~Vinod

\
 
 \ /
  Last update: 2016-09-30 19:39    [W:0.296 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site