From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbdFVHHH (ORCPT ); Thu, 22 Jun 2017 03:07:07 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:36026 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbdFVHHG (ORCPT ); Thu, 22 Jun 2017 03:07:06 -0400 Subject: Re: [PATCH] clocksource/drivers: fix uninitialized variable use in timer_of_init To: Arnd Bergmann , Thomas Gleixner Cc: linux-kernel@vger.kernel.org References: <20170621215005.3870011-1-arnd@arndb.de> From: Daniel Lezcano Message-ID: <4b8d12fa-a6e8-711b-1f32-1d5561322dba@linaro.org> Date: Thu, 22 Jun 2017 09:07:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170621215005.3870011-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/2017 23:49, Arnd Bergmann wrote: > If none of the flags are set, 'ret' is uninitialized as pointed out > by gcc: > > drivers/clocksource/timer-of.c: In function 'timer_of_init': > drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > Since calling the function without any of the flags is an error, > set the return value to -EINVAL for that case. > > Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine") > Signed-off-by: Arnd Bergmann > --- Thanks for the fix! -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog