From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAB3A606A31C for ; Sun, 29 Nov 2026 00:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EcYtH2yZ; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LhcQph9P DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=mHxAgTiHEzvyPDRTlS2p9ZzbYlTZ8M3Pgr4gCaceIxg=; b=EcYtH2yZjuVlRR YwjqatAyXvbvYqpjyV/I5OnV32meMHD89/CHEgwTW0ZvMb9qzIDyxGkmsC6I2k0M+9xD5b11aKfbD qyt+kjwgIQ+7ax1+Zs6YVpEvfNg3E6FMlSrgeI/kB5t0SWJE8FU5ymC0dIFt7BHsVHD8l3EAfiui2 gK3/y+phOSHfEjgbUvwcYieWpnFrAJa7FdUP+wfE55fT7P1F9YSTKQkMtOS8LymqgjJWtY773Ae2e CA9kgC5qSRSBjJ0TMcowECxx5w8+HoP7FrPjzfh7fqWJ7dpPiuzVI1MVpY0OfyDZOeLRJ5YNQvKu+ sZajMHMTEax4G1Ja/wOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXScw-00000001MZS-02v2; Sun, 29 Nov 2026 00:18:46 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xXScu-00000001MZE-2xLn for linux-arm-kernel@lists.infradead.org; Sun, 29 Nov 2026 00:18:44 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2BEED60CDE; Sun, 29 Nov 2026 00:18:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 715741F000C1; Sun, 29 Nov 2026 00:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795911523; bh=mHxAgTiHEzvyPDRTlS2p9ZzbYlTZ8M3Pgr4gCaceIxg=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LhcQph9PyPnSm7IXSIHP5piupOIkSfF+1LHwPtUDO9JbKfsSt7i1t4K+3ZRq5fq48 hVx+Ae/K5vz+oIPhkMgHWsE89BgYwU+RZH4e4iaw6Fg4rhZ9poTuxQUZKEwoKoZjFo deN+zIODHFjn38Pl9CeVVWqVbYyZzV+iQc3nxk7HsRSmWxz0lm/S5AUCV8/SR5NCMC iYHsCLsKq28lAx0RT5VZ9dkUjFMOElONnF8+kt062TcQJ8hefJJy91rjvOl/YpNE39 RfAu0j13yhMtFnflnLDZt1k7UeDBf0iiXCqLc/X1GQkocJEGCbHu2XZui2HNVFB15p M/oP+2LA6vWRw== Date: Sun, 29 Nov 2026 00:18:35 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Abdelnasser Hussein , linux-iio@vger.kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, giorgitchankvetadze1997@gmail.com, amin.gattout@gmail.com, antoniu.miclaus@analog.com, gregkh@linuxfoundation.org, mripard@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/3] iio: adc: at91_adc: fix NULL pointer dereference on trigger remove Message-ID: <20261129001835.7ebee1a5@jic23-hlaptop> In-Reply-To: References: <20261117140510.391907-1-abdelnasserhussein11@gmail.com> <20261117140510.391907-2-abdelnasserhussein11@gmail.com> <20261122002118.723b23b3@jic23-hlaptop> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, 23 Nov 2026 11:31:41 +0200 Andy Shevchenko wrote: > On Sun, Nov 22, 2026 at 12:21:18AM +0000, Jonathan Cameron wrote: > > On Tue, 17 Nov 2026 18:45:29 +0200 > > Andy Shevchenko wrote: > > > On Tue, Nov 17, 2026 at 06:44:37PM +0200, Andy Shevchenko wrote: > > > > On Tue, Nov 17, 2026 at 04:05:08PM +0200, Abdelnasser Hussein wrote: > > ... > > > > > > for (i = 0; i < st->caps->trigger_number; i++) { > > > > > + if (!st->trig[i]) > > > > > + continue; > > > > > iio_trigger_unregister(st->trig[i]); > > > > > iio_trigger_free(st->trig[i]); > > > > > } > > > > > > > > Yes, but no. Please, rather fix the above mentioned IIO trigger APIs to be > > > > NULL-aware. > > > > > > Actually the iio_trigger_free() is already NULL-aware, so make it only for > > > iio_trigger_unregister(). > > > > I'd rather we didn't. Any code that is unregistering a trigger > > that it didn't register is probably really very very buggy. > > I'd like them to crash or at least guarantee that sashiko > > flags it. We could add a warn if it is called on NULL I suppose > > but that is ugly. > > Can we add a comment there to avoid making such a change explaining > why we won't iio_trigger_unregister() be NULL-aware? I guess so given the question got raised. Jonathan >