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 X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B3D9C83035 for ; Sat, 28 Nov 2020 22:22:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AF4C223C6 for ; Sat, 28 Nov 2020 22:22:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qyXpF6Sp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725989AbgK1Vt2 (ORCPT ); Sat, 28 Nov 2020 16:49:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:49434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732535AbgK1TBy (ORCPT ); Sat, 28 Nov 2020 14:01:54 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A0B02466D; Sat, 28 Nov 2020 13:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606569957; bh=wlRpR5k7tSed5+Y/LjhaD1wUPthFRlO6ecBs7oG5hHE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qyXpF6SpgPF8iY8EUePUJsiv1JNSdeUpCyxkFYYJaSNq+1jgC97oDUbtarg61kpV9 pn9uaMgHeCKBgaBuW3oMi2acFODI2OPwuTtLsDYatF0Mfi2sIhHkyXvvI09HamRxO0 85mMqV3o+xmJNp46PoYgcIwQ6zLmj61RUOz0I1pU= Date: Sat, 28 Nov 2020 13:25:51 +0000 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Cc: , , Lars-Peter Clausen , Peter Meerwald-Stadler , Olivier Moysan , Arnaud Pouliquen , Takashi Iwai , Mark Brown , Jaroslav Kysela , Liam Girdwood Subject: Re: [PATCH 0/2] Make cb a required parameter of buffer-cb Message-ID: <20201128132551.4006f293@archlinux> In-Reply-To: <20201121161457.957-1-nuno.sa@analog.com> References: <20201121161457.957-1-nuno.sa@analog.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sat, 21 Nov 2020 17:14:55 +0100 Nuno S=C3=A1 wrote: > When going through the code of the buffer-cb interface and all it's > users, I realized that the stm32_adfsdm driver is calling > `iio_channel_get_all_cb()` with NULL for the cb. After going a bit > trough the stm drivers, it looks like this is actually intentional. > However, it is clear that we have a clear/direct route here for a NULL > pointer dereference. This change makes cb a required parameter of the > API. >=20 > The first patch makes the necessary changes to the stm32_adfsdm driver > so that it does not break. >=20 > Nuno S=C3=A1 (1): > iio: buffer: Return error if no callback is given >=20 > Olivier Moysan (1): > ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback >=20 > drivers/iio/buffer/industrialio-buffer-cb.c | 5 +++++ > sound/soc/stm/stm32_adfsdm.c | 12 +++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) >=20 Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to do their magic. Thanks, Jonathan 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 X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3D2AC63697 for ; Sat, 28 Nov 2020 13:27:03 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E60C22465A for ; Sat, 28 Nov 2020 13:27:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ZNXqWDa3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qyXpF6Sp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E60C22465A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BC72F1858; Sat, 28 Nov 2020 14:26:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BC72F1858 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606570019; bh=wlRpR5k7tSed5+Y/LjhaD1wUPthFRlO6ecBs7oG5hHE=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ZNXqWDa3Mlf8XIzUsxIvWxBQw/Uqk+s22/4GOVUGMbgQ1gP1lu4KB/ypvyFFkRC6t qijMClM0aIciMTZV3uGRi0uZV8Yyn1XIbBe0CSwCRCaSupzDhZv6QdQ9wPGcApN6YG o83k/e89v0U4LS+p2HijupUaHauH62YDu4dYE25E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 43BE1F800D0; Sat, 28 Nov 2020 14:26:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 703BCF80166; Sat, 28 Nov 2020 14:26:08 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9A6E5F800D0 for ; Sat, 28 Nov 2020 14:26:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A6E5F800D0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qyXpF6Sp" Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A0B02466D; Sat, 28 Nov 2020 13:25:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606569957; bh=wlRpR5k7tSed5+Y/LjhaD1wUPthFRlO6ecBs7oG5hHE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qyXpF6SpgPF8iY8EUePUJsiv1JNSdeUpCyxkFYYJaSNq+1jgC97oDUbtarg61kpV9 pn9uaMgHeCKBgaBuW3oMi2acFODI2OPwuTtLsDYatF0Mfi2sIhHkyXvvI09HamRxO0 85mMqV3o+xmJNp46PoYgcIwQ6zLmj61RUOz0I1pU= Date: Sat, 28 Nov 2020 13:25:51 +0000 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Subject: Re: [PATCH 0/2] Make cb a required parameter of buffer-cb Message-ID: <20201128132551.4006f293@archlinux> In-Reply-To: <20201121161457.957-1-nuno.sa@analog.com> References: <20201121161457.957-1-nuno.sa@analog.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Olivier Moysan , Liam Girdwood , linux-iio@vger.kernel.org, Arnaud Pouliquen , Takashi Iwai , Mark Brown , Peter Meerwald-Stadler X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Sat, 21 Nov 2020 17:14:55 +0100 Nuno S=C3=A1 wrote: > When going through the code of the buffer-cb interface and all it's > users, I realized that the stm32_adfsdm driver is calling > `iio_channel_get_all_cb()` with NULL for the cb. After going a bit > trough the stm drivers, it looks like this is actually intentional. > However, it is clear that we have a clear/direct route here for a NULL > pointer dereference. This change makes cb a required parameter of the > API. >=20 > The first patch makes the necessary changes to the stm32_adfsdm driver > so that it does not break. >=20 > Nuno S=C3=A1 (1): > iio: buffer: Return error if no callback is given >=20 > Olivier Moysan (1): > ASoC: stm32: dfsdm: add stm32_adfsdm_dummy_cb() callback >=20 > drivers/iio/buffer/industrialio-buffer-cb.c | 5 +++++ > sound/soc/stm/stm32_adfsdm.c | 12 +++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) >=20 Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to do their magic. Thanks, Jonathan