From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FEDCC49ED7 for ; Fri, 13 Sep 2019 13:19:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EEAD20640 for ; Fri, 13 Sep 2019 13:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380785; bh=6ju7qoV4XtxiOYiydTZ/xi21M3nC3WCFupiG3JE4sJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fMYI3jphnG0HltaBsT+OZSz8ztYFgJ12SSJNO8vgPXrZCO6M961IudJCOCtwgKo6x sHkEMCjZmWZy06nJkdDCTpVf8LizZd9vqrXjPoiafT5MUJgSEr9yEGYAb2WI0DpZWo 2ysZGdTKVl59/T2hlAU4YnrDH4y/a9puSYQRP+8I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730329AbfIMNTh (ORCPT ); Fri, 13 Sep 2019 09:19:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:47836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730276AbfIMNTg (ORCPT ); Fri, 13 Sep 2019 09:19:36 -0400 Received: from localhost (unknown [104.132.45.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B9F920717; Fri, 13 Sep 2019 13:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380775; bh=6ju7qoV4XtxiOYiydTZ/xi21M3nC3WCFupiG3JE4sJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cdiBhIoSsnx+2p+c6yJDy9FPIAuYZW3psvk6Od4zR1EG2p15Lr92vfjoqQpvE1msW Z8oajTS5434TFB7XXDeKD1G7fdzqsHlhcir9DV4o4d1imAeCJ8SIohKDZtxcDJl4HM GGzA9S2VybkR2E5KwBGvLJJvUlLUCp9L1D9n7B/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Wolfram Sang , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.19 175/190] iio: adc: gyroadc: fix uninitialized return code Date: Fri, 13 Sep 2019 14:07:10 +0100 Message-Id: <20190913130613.727863726@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130559.669563815@linuxfoundation.org> References: <20190913130559.669563815@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 90c6260c1905a68fb596844087f2223bd4657fee ] gcc-9 complains about a blatant uninitialized variable use that all earlier compiler versions missed: drivers/iio/adc/rcar-gyroadc.c:510:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] Return -EINVAL instead here and a few lines above it where we accidentally return 0 on failure. Cc: stable@vger.kernel.org Fixes: 059c53b32329 ("iio: adc: Add Renesas GyroADC driver") Signed-off-by: Arnd Bergmann Reviewed-by: Wolfram Sang Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/adc/rcar-gyroadc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c index dcb50172186f4..f3a966ab35dcb 100644 --- a/drivers/iio/adc/rcar-gyroadc.c +++ b/drivers/iio/adc/rcar-gyroadc.c @@ -391,7 +391,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) dev_err(dev, "Only %i channels supported with %s, but reg = <%i>.\n", num_channels, child->name, reg); - return ret; + return -EINVAL; } } @@ -400,7 +400,7 @@ static int rcar_gyroadc_parse_subdevs(struct iio_dev *indio_dev) dev_err(dev, "Channel %i uses different ADC mode than the rest.\n", reg); - return ret; + return -EINVAL; } /* Channel is valid, grab the regulator. */ -- 2.20.1