From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933157AbcI3Riv (ORCPT ); Fri, 30 Sep 2016 13:38:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:3641 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932648AbcI3Rin (ORCPT ); Fri, 30 Sep 2016 13:38:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,273,1473145200"; d="scan'208";a="15485646" Date: Fri, 30 Sep 2016 23:17:18 +0530 From: Vinod Koul To: Arnd Bergmann Cc: Dan Williams , Peter Ujfalusi , Tony Lindgren , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] edma: avoid uninitialized variable use Message-ID: <20160930174718.GV2467@localhost> References: <20160930161909.120176-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160930161909.120176-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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