Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1211952rdb; Mon, 2 Oct 2023 02:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGc7UYSN3XhmAmVVspuO1kNCEdqe4YGcB3TxDThJn8AZ75M1bAlEkBLg4/kVAe144d6o0+V X-Received: by 2002:a17:90a:31c4:b0:274:7fbd:9bc0 with SMTP id j4-20020a17090a31c400b002747fbd9bc0mr8462285pjf.7.1696239716326; Mon, 02 Oct 2023 02:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696239716; cv=none; d=google.com; s=arc-20160816; b=w68mRaY5P+x/XXA+eOjaJI5UklBcUDk0AY56rZCqlLqCYSG6lpZavlx/ji2XeiFeAy stg4o6LZNQBtQmJM7XzuMCeUEodCtT0WyReCfDzNldmtFphZplKyi+D2FkxOCPaObrqs oPmM3N8nZOX7WtEOuQCSYfiFqhaXpEXGLkyt+Khdv3Hv18sYXy326WVpNTyEYPTBPjr+ lkXMBZB/fbWRuKIAUYrIfdoCjcEGv7Z531pHvbe5BmPa4TicDzGvHraGzIn3pgG4kNb9 LYCXS0Z+YQQOKkJ5uuXZsv9c6uDprUosMtwpNeMLraZKl8vw828cMFNWpLQksXhnF4l5 AWMg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=cTdn6GSLXsv5v/OXy+DR7Vk6sjt2mLVjlA1lDSNvZ9o=; fh=MpdLV7VX0tB8Jbz/r3NK7lmFULIhBJqK5bTNtcnqRzI=; b=O3Ew3ei+ycQqQ6KdW2Qbs0yeuvGcDSQ6XtOv8GgaHqphyy16LOe2ZjJoednHS+KnGO C1HKl8maF2JoPzs9kya/qwJkDzMcnkL4tQfSEOoDCq/8/xfocedFMBw6qjhl39s0OW1m 2yJ7LQBWe5ha1fq40s1h/ajZkc0WPejO64ablfoxo1BwWADzkRyDjl5Q35AZza/sVZlp OIvLEA2uP6Zrgpx3K3xhQjmdyitjVhj0s3JFu9EOnfws0zzWBAajho/CeSqVvU4a5l9v y+1FMhQ2aUzRF3QCXxvFQsPLLpiuVKYxRSeciNrcUUNSxLkdfRifRvDsJe6l9Sz7lga/ uNVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id em24-20020a17090b015800b00277517b42dasi7086586pjb.35.2023.10.02.02.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 02:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C0C108059E4B; Mon, 2 Oct 2023 02:17:56 -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 S236052AbjJBJRu (ORCPT + 99 others); Mon, 2 Oct 2023 05:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235965AbjJBJRs (ORCPT ); Mon, 2 Oct 2023 05:17:48 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F33B93; Mon, 2 Oct 2023 02:17:46 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Rzb2S44nNz67L0F; Mon, 2 Oct 2023 17:17:36 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 2 Oct 2023 10:17:43 +0100 Date: Mon, 2 Oct 2023 10:17:42 +0100 From: Jonathan Cameron To: Dan Carpenter CC: David Lechner , , , , David Lechner , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?ISO-8859-1?Q?S?= =?ISO-8859-1?Q?=E1?= , Axel Haslam , Philip Molloy , , Vincent Whitchurch Subject: Re: [PATCH v3 02/27] staging: iio: resolver: ad2s1210: fix use before initialization Message-ID: <20231002101742.0000774b@Huawei.com> In-Reply-To: <1b366292-6e05-421e-914e-6d3457886238@kadam.mountain> References: <20230929-ad2s1210-mainline-v3-0-fa4364281745@baylibre.com> <20230929-ad2s1210-mainline-v3-2-fa4364281745@baylibre.com> <1b366292-6e05-421e-914e-6d3457886238@kadam.mountain> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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]); Mon, 02 Oct 2023 02:17:56 -0700 (PDT) On Mon, 2 Oct 2023 11:07:15 +0300 Dan Carpenter wrote: > On Fri, Sep 29, 2023 at 12:23:07PM -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 > > --- > > > > Fixes: b19e9ad5e2cb ("staging:iio:resolver:ad2s1210 general driver cleanup.") Thanks but nope, not that one. At that point ad2s1210_setup_gpios, didn't use st->sdev. I think this went wrong when the platform data was removed in I 'think' it was Fixes: f356dc6ec26b ("staging: iio: ad2s1210: Switch to the gpio descriptor interface") > > This would crash the driver right away, on probe. It's amazing no one > filed a bug report even though the bug is 12 years old. Only 5 years :) Welcome to the long tail of IIO Devices and the long term availability of the hardware - this is still a production part. Clearly no one was using the upstream driver for 5 + years, but here comes David who is not only fixing the bugs but cleaning it up. Hmm. What happened to roadtest? I was hoping that would solve this sort of issue by allowing simple testing of basic functionality... Hope it is still headed for a new version / upstream! Jonathan > regards, > dan carpenter