Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp365292rdb; Sat, 30 Sep 2023 07:28:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMcsxMF0SNuy4Jb3zTO9jlpBEKt79I3Jm5wTzT0xFgU9nrweTh5FXYPKItJ7jU+Glf1oKP X-Received: by 2002:a17:90a:f2d5:b0:26b:280b:d24c with SMTP id gt21-20020a17090af2d500b0026b280bd24cmr5952055pjb.42.1696084118256; Sat, 30 Sep 2023 07:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696084118; cv=none; d=google.com; s=arc-20160816; b=H6VxJpxWxp/c9BRXAkADCINr+bQfLECS/Aau4eNr2n1+REiWeGJPVNqay9va3xyYLY Sv70COISiBRwze/tr4+ARTdK+1tqVDAu1cC13BC/kFhxVZ6ubWFYwZcu5NeS40Yg7Moq 6a13tYdCjEzp07zUk1BdxzcGoMMuLFcr2lk/38N8+47zaMKZFztJZtwgOLbm5/IiUx80 1k0f1ZGVG6TlIeJM2OPehPla9hfAlI+mfqt5s1qx5GvQwpcO8qvrPGwMk9BZKDQNv6yB xm0asV0eSq3rI7V6rIriuzZex4ctPvXgr+tjoXFO80HEc/DBz/tR8NkYU5ukwGc9XVVe vHCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JV3hJqCYXZ5kQOD60fWd4Ap3LLeVY1aAQRr6Zp66Cis=; fh=e9lXfbAZmLMG/YSSxlbXRgGopMc52ojan+iACBc5a/Y=; b=daIeiNIS29WlAJuB3AzFVN+CvaRBZ/GN9snIgdNLtst7sHSUT5l5p3iZq7VqN/pNSU M9P4hnECsTidbOHYy+uGYslhr3O7ak8S79o6O9VVtEFuketCQOJLRnBHi9NOdg7CnNzZ 0HJtsdP4nkJ6SZGn1oNEdnk8MqbQfLSf88oTRkhp8eiUiYCpMdqQmNDiObLQZj0y+Dgt GZUSu7awTRU9HfAU+NtZ7ODlDr/5NcRZLSxJU9HGRDE1F86yta+jRY1ao5+Zwd9lo8Y9 TR+JNMgMHrxlRJS274K/JXWLvIpNTYVkJeHGX3gScNOaqXtSoPDUruQPmsrdi3dp8W2I ZZ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SVUzApjX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s6-20020a17090a6e4600b00274d1a584dfsi3655217pjm.107.2023.09.30.07.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 07:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SVUzApjX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6669680E65B7; Sat, 30 Sep 2023 07:28:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234281AbjI3O2f (ORCPT + 99 others); Sat, 30 Sep 2023 10:28:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234225AbjI3O2e (ORCPT ); Sat, 30 Sep 2023 10:28:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE409C2; Sat, 30 Sep 2023 07:28:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30BF1C433C8; Sat, 30 Sep 2023 14:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696084112; bh=EFUuCbhUP3y4UwQR6s/o4IYaEP1EMEPhSS82/Wkm9DM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SVUzApjXL+nBzojIYxm/i1UPgw7x+roRjgFjtNC4QC0UGB08akDwz+SIFvvn2rx36 Eyvyx6555HC+ZCcg6XiJZ8xNr3BJIBOtmXMBifeG1Umw9qYjTtWfMfbPEFB17D92Gn qwr3zCKFznnqROfTnSMwis7pcQh6fFd25vS7YJZ+MzEfNvA/xdzyu4UxbCNn0rK5zM JwDnLFyW4flvri+ZHgdGW21HAzLcEegcxCKICMdF+hFXwYgpAvWUb7RMIBjeTfLFvx 1MvjNmdFJKeuogZodPlrm8n5YHfGKc33bKWsGQ+jaWyY4ezwKrlF8fUZpzM4VQ88OU 2ZRC1fOHlii4A== Date: Sat, 30 Sep 2023 15:28:31 +0100 From: Jonathan Cameron To: David Lechner Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev, David Lechner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Axel Haslam , Philip Molloy , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 02/27] staging: iio: resolver: ad2s1210: fix use before initialization Message-ID: <20230930152831.432647d7@jic23-huawei> In-Reply-To: <20230929-ad2s1210-mainline-v3-2-fa4364281745@baylibre.com> References: <20230929-ad2s1210-mainline-v3-0-fa4364281745@baylibre.com> <20230929-ad2s1210-mainline-v3-2-fa4364281745@baylibre.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 30 Sep 2023 07:28:37 -0700 (PDT) On Fri, 29 Sep 2023 12:23:07 -0500 David Lechner wrote: > From: David Lechner > > From: David Lechner > > This fixes a use before initialization in ad2s1210_probe(). The > ad2s1210_setup_gpios() function uses st->sdev but it was being called > before this field was initialized. > > Signed-off-by: David Lechner Applied to the togreg banch of iio.git and pushed out as testing for 0-day to poke at it. I didn't pull this out as a fix to upstream quicker because it would make a mess of the rest of applying the rest of the series. Maybe we want to consider backporting some of these at somepoint. Jonathan > --- > > v3 changes: > * This is a new patch split out from "staging: iio: resolver: ad2s1210: > fix probe" > > drivers/staging/iio/resolver/ad2s1210.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c > index f695ca0547e4..3f08b59f4e19 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.c > +++ b/drivers/staging/iio/resolver/ad2s1210.c > @@ -658,9 +658,6 @@ static int ad2s1210_probe(struct spi_device *spi) > if (!indio_dev) > return -ENOMEM; > st = iio_priv(indio_dev); > - ret = ad2s1210_setup_gpios(st); > - if (ret < 0) > - return ret; > > spi_set_drvdata(spi, indio_dev); > > @@ -671,6 +668,10 @@ static int ad2s1210_probe(struct spi_device *spi) > st->resolution = 12; > st->fexcit = AD2S1210_DEF_EXCIT; > > + ret = ad2s1210_setup_gpios(st); > + if (ret < 0) > + return ret; > + > indio_dev->info = &ad2s1210_info; > indio_dev->modes = INDIO_DIRECT_MODE; > indio_dev->channels = ad2s1210_channels; >