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 96A3428ED for ; Mon, 12 Dec 2022 13:38:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7138EC433EF; Mon, 12 Dec 2022 13:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670852323; bh=/iiifIrbB8I5Ox3Ht3C7dh7xdF3G1FA0hTo0Xjk/KYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hLOXoNR7uc45fi+6wNaqaS3W0V4VpG0d2syfjkD22puWHZ8GiEEiSfyi7XeoiAwi1 BgVTmtphvbet5wCar99DPq1PnLPQyrxstmTOa6qEp3uBcdtPh00qAYEwD3X0nbsiOl qnuofMOpbiN6O8u1MSnW5x1vg8ZwsnUPafvEajMM= 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 6.0 032/157] ASoC: soc-pcm: Add NULL check in BE reparenting Date: Mon, 12 Dec 2022 14:16:20 +0100 Message-Id: <20221212130935.815711094@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212130934.337225088@linuxfoundation.org> References: <20221212130934.337225088@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 f6a996f0f9c7..f000a7168afc 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1242,6 +1242,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