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=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 1AF2CC5519F for ; Sun, 22 Nov 2020 16:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C12172076E for ; Sun, 22 Nov 2020 16:20:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UolgD4Mt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727938AbgKVQTq (ORCPT ); Sun, 22 Nov 2020 11:19:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:50958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727936AbgKVQTp (ORCPT ); Sun, 22 Nov 2020 11:19:45 -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 A624420781; Sun, 22 Nov 2020 16:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606061985; bh=I7DAoSVxbe5d/oBZUnILWIvrXbLNJ7O1BlXExpKNEP8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UolgD4MtdDiXWjuh/o6cL+6lVT0C4go1dSislsKtoqDkW5Vn9p00Xlm6yCTHdoNMb h3asqYyriQDWGv24zdkVMPVMWqCK4pVCX3313cswxKTuoQ778tZkrlGHZFBmrlNqM0 gC2KEKBWdkvQzDFGJnBVNdz1Hd+sbYsxOMcmxMpM= Date: Sun, 22 Nov 2020 16:19:41 +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: <20201122161941.4e7b8418@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. Looks good to me. Will leave it a bit longer to let ASOC people take a quick look at it. Give me a poke in a few weeks if it seems like I might have lost it! Thanks, Jonathan >=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 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=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 5CB33C5519F for ; Sun, 22 Nov 2020 16:20:51 +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 6B8CD20781 for ; Sun, 22 Nov 2020 16:20:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FnFk19fp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UolgD4Mt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B8CD20781 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 44FA61658; Sun, 22 Nov 2020 17:19:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 44FA61658 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1606062047; bh=I7DAoSVxbe5d/oBZUnILWIvrXbLNJ7O1BlXExpKNEP8=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FnFk19fpEQ/7VjEayZdBK1yH1XZtbeAkBi5GQJOdSb9TiVLNNAhxO2R4lXlT28VBC rHCGnUbOArbCVYp/Zl4IC6WnAZWqIXYLUGsIyFTmDl0B66k8mviUKVV5RK9o7rLUCP c5T5jtO/IPwbmnZLrXaBlrD59162XCRTjUEQ431Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A18E3F80161; Sun, 22 Nov 2020 17:19:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15EFEF80165; Sun, 22 Nov 2020 17:19:55 +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 0F80BF80113 for ; Sun, 22 Nov 2020 17:19:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0F80BF80113 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UolgD4Mt" 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 A624420781; Sun, 22 Nov 2020 16:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606061985; bh=I7DAoSVxbe5d/oBZUnILWIvrXbLNJ7O1BlXExpKNEP8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UolgD4MtdDiXWjuh/o6cL+6lVT0C4go1dSislsKtoqDkW5Vn9p00Xlm6yCTHdoNMb h3asqYyriQDWGv24zdkVMPVMWqCK4pVCX3313cswxKTuoQ778tZkrlGHZFBmrlNqM0 gC2KEKBWdkvQzDFGJnBVNdz1Hd+sbYsxOMcmxMpM= Date: Sun, 22 Nov 2020 16:19:41 +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: <20201122161941.4e7b8418@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. Looks good to me. Will leave it a bit longer to let ASOC people take a quick look at it. Give me a poke in a few weeks if it seems like I might have lost it! Thanks, Jonathan >=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