From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A858828ED for ; Mon, 12 Dec 2022 13:22:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F3BFC433EF; Mon, 12 Dec 2022 13:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670851334; bh=kodpPhPiGEHVncs7lHlgeyBV0cizVTBtEmqJi9UoSh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGGXyAc/ptz5ur42rUEwkO0QD93j6e6h/cclRdpbwy9YA2jhswK7mjR3Vji23AaLF fza3KzUcqpKa4H/o3/uN/lfiJ++LSukhvI7TEKxvU3fKzKfYl0C1X6g4qBiM4cSg7r v811FbIz2aIBjKVqPCk6JTIqcrCeAcAjALd8sVE8= 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 5.4 12/67] ASoC: soc-pcm: Add NULL check in BE reparenting Date: Mon, 12 Dec 2022 14:16:47 +0100 Message-Id: <20221212130918.207563059@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212130917.599345531@linuxfoundation.org> References: <20221212130917.599345531@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 1196167364d4..2f1ab70a68fc 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1201,6 +1201,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; for_each_dpcm_fe(be, stream, dpcm) { if (dpcm->fe == fe) -- 2.35.1