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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0BBBC4332F for ; Fri, 25 Nov 2022 11:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cvmvohK954uSz+hrAzroCVHiQCU/ewS2y9KIn8Y4A9A=; b=htkKRSd4qt4d61 nK3Td9kUXNV3I60xFDpPzP+AZcXTZ4XWP418Lq13oChqiRByWeC6AGojvpbWRIWvdMloly9xkpuCy IYc7f9kpRQpgsFegO9s7DALdVN0p5EtY4PBoyX/hjR3+YKFVV0jmcvdOTKYYw32d2tKgwr8ofSDgm T756Yp/Vl72YumBx7kVNacmRSpnF2NsatUN9e5xHH75RHp63SQ0k0MWuOzjSTl3AbwzOypxF/S4OU IAADWwQop3n0zuJHvBEM3IqvDnlkhEulccYqK9J8Q40URVop0UifxaOXOFuWJvpDT2Co3BnLJDbLa bQMgKC6NzZ974zKaTgJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyWxE-00G9SY-PU; Fri, 25 Nov 2022 11:33:14 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyWx5-00G9PK-7H for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 11:33:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669375981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o0whn50hBaBPJSQq4RKgv9QraGn/cvKe5x1wVFmyAmE=; b=B0VL2zzpp0I1a8H1TvqpewLjCWjRAxR0n/kHNOLQ04DMJ4WWphINM79gU7rNB1HLiwCpLL TF+SMBhtv6546SM3+eYLCgoDZkKuHqc/ZjHdYo7iz1irmOqJbMvDxAEE6cF3QFfVxqntZ1 1owIU1nJjoIu7RtCaUOu6ju1NGdVBA0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-550-MwDwT-JKNRCzfzLnzJBLcg-1; Fri, 25 Nov 2022 06:31:21 -0500 X-MC-Unique: MwDwT-JKNRCzfzLnzJBLcg-1 Received: by mail-qv1-f72.google.com with SMTP id nn2-20020a056214358200b004bb7bc3dfdcso3479131qvb.23 for ; Fri, 25 Nov 2022 03:31:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o0whn50hBaBPJSQq4RKgv9QraGn/cvKe5x1wVFmyAmE=; b=2EVPWMmjwaNpQtveYJRxY129/RsiSmmULcfyLCotXPY3O+kw/KEk23DQd1saQo0+Vj 5X1nsq42W3r02rHN6mRwIZLvyXy2FoQVLmDveNs8jFXEMhsohEb6pUgevJ7FYvpuXnbN 5Rl4oWHdewRjtPheDkUnogXBoh8RQIuNnACMNCgJ5f3Lf51UJT/f4gas2ub4A2FWlZ/x jb9VXdWKvvTjSdl/iKNPQV5zNx1ov6AOGcHuVnsxanwja959eSnNV3BTTgACNIg0EjZZ KbWcVFQ/FYUnDO9dbbS6RAGhvL/Ld3qGCOPGDTsA1dVB5FwaNM8YeKJPaLsF7ocQOFkE uHhA== X-Gm-Message-State: ANoB5pmHNO+aJr2Uw9yP0v/Wjq67YG5s2PZs6MAx7B21jUElFxhfR0Dh GiS8MZVG2pR/G/FfRKL77Vg4fRMs7BR1ir5Bk+0DbSj8PU7dm1dSV2wCH8SD8lVf/doCUe9Ec0H VO3F4YuYEQiWxeHWR2FciaLS5i/Q0pV2HyA== X-Received: by 2002:ac8:734d:0:b0:3a5:2784:f462 with SMTP id q13-20020ac8734d000000b003a52784f462mr18738803qtp.590.1669375880843; Fri, 25 Nov 2022 03:31:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5MrrxAhGW+JX7yXKj/nNSxGBgtw9E8v2y+gdjXK61hr+gPJZuL1eilM+sjR/92x2KZrbXqiw== X-Received: by 2002:ac8:734d:0:b0:3a5:2784:f462 with SMTP id q13-20020ac8734d000000b003a52784f462mr18738776qtp.590.1669375880599; Fri, 25 Nov 2022 03:31:20 -0800 (PST) Received: from klayman.redhat.com (net-2-34-28-144.cust.vodafonedsl.it. [2.34.28.144]) by smtp.gmail.com with ESMTPSA id q1-20020a05620a0d8100b006fc2f74ad12sm2581080qkl.92.2022.11.25.03.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:31:20 -0800 (PST) From: Marco Pagani To: Anand Ashok Dumbre , Jonathan Cameron , Lars-Peter Clausen , Michal Simek , Nathan Chancellor , Nick Desaulniers , Tom Rix , Manish Narani Cc: Marco Pagani , Jonathan Cameron , linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] iio: adc: xilinx-ams: fix devm_krealloc() return value check Date: Fri, 25 Nov 2022 12:31:12 +0100 Message-Id: <20221125113112.219290-1-marpagan@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_033303_433848_352FF541 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- drivers/iio/adc/xilinx-ams.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index 5b4bdf3a26bb..a507d2e17079 100644 --- 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 *indio_dev) 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; -- 2.38.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel