Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1300190rwo; Sat, 22 Jul 2023 10:16:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHDWI3khD+mJCpgMUaia+OcsWyW4jlnWEfVossL+OvOJFZma78tlVZNTy233RgQTFQztsZN X-Received: by 2002:a17:906:2250:b0:99b:49ac:318c with SMTP id 16-20020a170906225000b0099b49ac318cmr5257098ejr.70.1690046191729; Sat, 22 Jul 2023 10:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690046191; cv=none; d=google.com; s=arc-20160816; b=0TWvMFLryIWjzwVBkCho8W9qrhoJApFtWSelslLBgig8h1r/+BTT12bjd1XSyuvmDn U5Gge9eZkubG8V5+KGn6KDvqACg3QuPVnsYZ3tlYBK8jk6PTn7nS+T0v3d0i7jbS9U7o qUElcvL0WuCRwI5mElqk265giDhMF1a5+8rJN70sk2TzkKT8EKL7WfEcg0IaOzGQtxLQ Rquofc+uv/fl8xyCQLPcQkJ705/dLvb1DjGrhI7iruaE8tXPGMBrfabNzXA7xYLpFRY/ FW02+hpbhXF7cOaNUI/yFbWqxoGYpke73WIFKGkDLk/x6yz5EdWGmvwnJpPp83AMjpY6 cmUQ== 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=c3RQ4rA/Xb8wZTcTo6udqFzFHQW4Gn7mMuCDJhH3bm4=; fh=PppZ7CTqCnqAIIdZCar9DASt/ymM/REi4Nl1/6ys9R4=; b=dpcBV2Pj3a97CEWQNOUB+BQ+Ud88B0daUTphUkRt37egkbrMgXnuDcBtnfJGNs3epG Z+zRgg4j3nAQzOu3WxLFVbx6q0fNHLwCxvKlwWCYe/4rJaFG836u4cDjc/1uD/V8aPFY aXU459IsXaVk9VtiK2vMLE5IoYLPcuzIqSFFvl3Q1CJ5LUFurqC7P5CO6dlMPhF1zkv4 3u3ZMqk6rGN1qmEWFxgCU9mlErVX+UtnwXKU/SOXUVs9YD08OyzkvhOe90s+ODbUR24y pgakgjE2okZTEDeGtThFdsXf3wYAUnqQiCKtrfBot0KulliXqwL5v+N40MVDr1Ad/nT7 5F7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M4QMkDp2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a1709061c4600b009929566f00asi3843243ejg.467.2023.07.22.10.16.06; Sat, 22 Jul 2023 10:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M4QMkDp2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjGVQxi (ORCPT + 99 others); Sat, 22 Jul 2023 12:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjGVQxg (ORCPT ); Sat, 22 Jul 2023 12:53:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 338B71A1; Sat, 22 Jul 2023 09:53:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD0F760B06; Sat, 22 Jul 2023 16:53:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D819CC433C7; Sat, 22 Jul 2023 16:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690044815; bh=Y29p/fyLP/yVWP0radrZBPnFb3gL4bnZcfdmPVFRRtM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=M4QMkDp2kGt5STnfWhJkOy/+l0IUZ0ny7T7N2BPIdexHV9XgsjpqQXPLo2m58Keca 9hkpGmyJkgPT96sMMBruP8I2zeLXrHOGC1L/u+srkxR86XPHjntWFoew+/r7APg5Mo fpsiIgaLgwmIUwfs/s6CzoLH0WkvuiqWURVliwOOvl64/+jVjtUOuv3C4hpXImR38e 9MdH7QPmxqEgc7KngHMSyd2uX4ctzy+QyInwCcCD9KbGAPCp+VfvN9SG1lPUHhZRmG L01VFFTEtGErn65fvkNMg9vYB3/AKdHMRfQ7wx307p9CwzDTjcmkUMXSsOFn7c7PvO yTyGMGEvGVfWw== Date: Sat, 22 Jul 2023 17:53:32 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Milan Zamazal , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Nuno =?UTF-8?B?U8Oh?= Subject: Re: [PATCH v3] iio: core: Prevent invalid memory access when there is no parent Message-ID: <20230722175332.3ac83cc8@jic23-huawei> In-Reply-To: References: <20230719083208.88149-1-mzamazal@redhat.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,T_SCC_BODY_TEXT_LINE 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 On Wed, 19 Jul 2023 18:27:45 +0300 Andy Shevchenko wrote: > On Wed, Jul 19, 2023 at 10:32:08AM +0200, Milan Zamazal wrote: > > > Changes in v3: > > - The call trace in the commit message reduced to the minimum lines > > needed to explain the problem. > > Precisely, that deserves my tag which I already had given :-) > Thank you! > Applied to the fixes-togreg branch of iio.git. In theory every device should have a parent, but this fix is more minimal than adding one for the dummy device (which we should still do - even if it's a virtual device of some type that we create just for this purpose). That reminds me, I was in process of fixing this for perf drivers and forgot to finish it off :) Jonathan