From patchwork Wed Jan 8 11:50:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 213607 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=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 64ED9C3F68F for ; Wed, 8 Jan 2020 11:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 348562077B for ; Wed, 8 Jan 2020 11:50:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="BAGd9+Gp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbgAHLua (ORCPT ); Wed, 8 Jan 2020 06:50:30 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:60932 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbgAHLua (ORCPT ); Wed, 8 Jan 2020 06:50:30 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200108115027euoutp01efc1871e19f6f382f1691c4adc706fe9~n5wrKnD8H0525005250euoutp01e for ; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200108115027euoutp01efc1871e19f6f382f1691c4adc706fe9~n5wrKnD8H0525005250euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1578484227; bh=3OyRPuFqCIRdzwH2FYDtdhnfPsBECJGMdvkxFH7m2yU=; h=From:To:Cc:Subject:Date:References:From; b=BAGd9+GpbtxPozyM4oukg80FyFdXjt5mYG6eW4cftmjYb2L/0Xw4m15L2bNdqjZnu //3gnXgfcuDsC1iX+DUBuDDG4xf3DuokfQ5DP6fZP6cIlFl7BbdQEss0dl2vpLmaDH ijRa5fPOe/voAuA9UPYvZiQeKI2Ghqx1jK6MzR/w= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200108115027eucas1p2d11eb4dc1d466e7dbd0b1b36075e8d9e~n5wq0UHpk3212532125eucas1p2k; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C6.03.60698.302C51E5; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200108115027eucas1p2abcd40e359e993e5b471229b02b69fc3~n5wqaRcR22915229152eucas1p2G; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200108115027eusmtrp28c6e206ae88bd77a88adeee8520cd1e0~n5wqZmVEb1831018310eusmtrp2Z; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-23-5e15c2035f05 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5E.A4.07950.302C51E5; Wed, 8 Jan 2020 11:50:27 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200108115026eusmtip16de4a492f67213a17e0ad1e60bd5ff50~n5wp4ZlIZ1983219832eusmtip1U; Wed, 8 Jan 2020 11:50:26 +0000 (GMT) From: Marek Szyprowski To: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Mark Brown , Sylwester Nawrocki , Tzung-Bi Shih , Dylan Reid , Jimmy Cheng-Yi Chiang , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 1/2] ASoC: max98090: fix incorrect helper in max98090_dapm_put_enum_double() Date: Wed, 8 Jan 2020 12:50:06 +0100 Message-Id: <20200108115007.31095-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42LZduznOV3mQ6JxBrfXKVpcuXiIyWLjjPWs FlMfPmGzOHG4kdmifWYHo8X58xvYLS7vmsNmMeP8PiaLtUfuslscftPOarHn4it2B26PDZ+b 2DwWbCr12LSqk82jb8sqRo/Pm+QCWKO4bFJSczLLUov07RK4Mrrab7EX/BWsmPWhmamB8Sh/ FyMnh4SAicTjB7vZuxi5OIQEVjBKLPjbxwjhfGGU6H83ByrzmVHiYvtGNpiWE3c3MUEkljNK /DgwgxEkAday8q4KiM0mYCjR9bYLrEFEIEni/ILbzCANzAKXmSRWN/YzgySEBeIk7u9+ANbM IqAqcar9H1icV8BW4trXjUwQ2+QlVm84ANYsIfCZTeL09qdQZ7hIbD2zggXCFpZ4dXwLO4Qt I/F/53wmiIZmRomH59ayQzg9jBKXmyBulRCwlrhz7hfQJA6gmzQl1u/Shwg7Siy4vAssLCHA J3HjrSBImBnInLRtOjNEmFeio00IolpNYtbxdXBrD164xAxhe0jseb6NBRIosRIzz75gncAo Nwth1wJGxlWM4qmlxbnpqcXGeanlesWJucWleel6yfm5mxiBSe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UnZ8+ydB2ysN+bxq/UWTuHneT2xagP3g/4jT960Op1vZfl/5o+mS8j+puT5FwQ+ zfW1S1diKc5INNRiLipOBAD0phjzawIAAA== X-CMS-MailID: 20200108115027eucas1p2abcd40e359e993e5b471229b02b69fc3 X-Msg-Generator: CA X-RootMTR: 20200108115027eucas1p2abcd40e359e993e5b471229b02b69fc3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200108115027eucas1p2abcd40e359e993e5b471229b02b69fc3 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers") extended the code for handling "LTENL Mux", "LTENR Mux", "LBENL Mux" and "LBENR Mux" controls by adding a custom max98090_dapm_put_enum_double() function to them. However that function used incorrect helper to get its component object. Fix this by using the proper snd_soc_dapm_* helper. This fixes the following NULL pointer exception observed on Exynos4412-based Odroid U3 board: 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 000000b0 pgd = (ptrval) [000000b0] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 1104 Comm: alsactl Not tainted 5.5.0-rc5-next-20200107 #166 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) PC is at __mutex_lock+0x54/0xb18 LR is at ___might_sleep+0x3c/0x2e0 ... Process alsactl (pid: 1104, stack limit = 0x(ptrval)) ... [] (__mutex_lock) from [] (mutex_lock_nested+0x1c/0x24) [] (mutex_lock_nested) from [] (max98090_shdn_save+0x1c/0x28) [] (max98090_shdn_save) from [] (max98090_dapm_put_enum_double+0x20/0x40) [] (max98090_dapm_put_enum_double) from [] (snd_ctl_ioctl+0x190/0xbb8) [] (snd_ctl_ioctl) from [] (ksys_ioctl+0x470/0xaf8) [] (ksys_ioctl) from [] (ret_fast_syscall+0x0/0x28) ... ---[ end trace 0e93f0580f4b9241 ]--- Fixes: 62d5ae4cafb7 ("ASoC: max98090: save and restore SHDN when changing sensitive registers") Signed-off-by: Marek Szyprowski --- sound/soc/codecs/max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 4c7b16d557e2..c01ce4a3f86d 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -82,7 +82,7 @@ static int max98090_dapm_put_enum_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_soc_component *component = - snd_soc_kcontrol_component(kcontrol); + snd_soc_dapm_kcontrol_component(kcontrol); struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component); int ret;