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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44AEFC636CD for ; Tue, 7 Feb 2023 13:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232271AbjBGNFo (ORCPT ); Tue, 7 Feb 2023 08:05:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232215AbjBGNFT (ORCPT ); Tue, 7 Feb 2023 08:05:19 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7E3F3A58F for ; Tue, 7 Feb 2023 05:05:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8489BCE1CA5 for ; Tue, 7 Feb 2023 13:04:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A744C4339B; Tue, 7 Feb 2023 13:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675775094; bh=sP9NFXg/tlRbb+P7nepIMIFKhcsu2YgWBrOPUaw2VAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CudZhk0jW6rI/c/d/zV6aG14zcK2WHvmYr6/aJ58jhrXKf0web96YJyRZXpoRzMfe Wwubdu4tFl1S97AvroXjbycpc/+8Idr0ZCjNyBFw+liBZEZab7sjzJIClP5lIK9tXP f3r2tiMEVI0ODGUluYptf045igiCWLjoSOH6W4LI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marco Pagani , Michal Simek , Jonathan Cameron Subject: [PATCH 6.1 134/208] iio: adc: xilinx-ams: fix devm_krealloc() return value check Date: Tue, 7 Feb 2023 13:56:28 +0100 Message-Id: <20230207125640.500768222@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207125634.292109991@linuxfoundation.org> References: <20230207125634.292109991@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marco Pagani commit 6794ed0cfcc6ce737240eccc48b3e8190df36703 upstream. The clang-analyzer reported a warning: "Value stored to 'ret' is never read". Fix the return value check if devm_krealloc() fails to resize ams_channels. Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") Signed-off-by: Marco Pagani Acked-by: Michal Simek Link: https://lore.kernel.org/r/20221125113112.219290-1-marpagan@redhat.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/xilinx-ams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -1329,7 +1329,7 @@ static int ams_parse_firmware(struct iio dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL); if (!dev_channels) - ret = -ENOMEM; + return -ENOMEM; indio_dev->channels = dev_channels; indio_dev->num_channels = num_channels;