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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69A34C4332F for ; Mon, 12 Dec 2022 13:54:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233241AbiLLNyC (ORCPT ); Mon, 12 Dec 2022 08:54:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233135AbiLLNxm (ORCPT ); Mon, 12 Dec 2022 08:53:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8098460C8 for ; Mon, 12 Dec 2022 05:52:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33377B80D54 for ; Mon, 12 Dec 2022 13:52:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ADFBC433F0; Mon, 12 Dec 2022 13:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670853171; bh=UaURbPuHpQtA0YRB1oWG4r32xC1LDY9emPmigIFWxUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MbE8sRugML2IVvZlprHcxzsDGW/K92gSd6VCD+DLJNgWj5vRNTL/MeBwEsIlY8F0z VUkjY0a+jg0a1Iaubn3tdW43v6ackLPBwyDwH7swlFIDwXTldQMKM0o/1Dkv3OqoWG CtO5zOaqMecXftlV2mnmnExsN88dRchQL9cTzj38= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Srinivasa Rao Mandadapu , Mark Brown , Sasha Levin Subject: [PATCH 4.14 07/38] ASoC: soc-pcm: Add NULL check in BE reparenting Date: Mon, 12 Dec 2022 14:19:08 +0100 Message-Id: <20221212130912.467433687@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212130912.069170932@linuxfoundation.org> References: <20221212130912.069170932@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Srinivasa Rao Mandadapu [ Upstream commit db8f91d424fe0ea6db337aca8bc05908bbce1498 ] Add NULL check in dpcm_be_reparent API, to handle kernel NULL pointer dereference error. The issue occurred in fuzzing test. Signed-off-by: Srinivasa Rao Mandadapu Link: https://lore.kernel.org/r/1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index e995e96ab903..3a9c875534c1 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1168,6 +1168,8 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe, return; be_substream = snd_soc_dpcm_get_substream(be, stream); + if (!be_substream) + return; list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { if (dpcm->fe == fe) -- 2.35.1