From patchwork Mon Nov 21 13:04:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 13050884 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B3EFAC4332F for ; Mon, 21 Nov 2022 13:06:35 +0000 (UTC) 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 C80BF823; Mon, 21 Nov 2022 14:05:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C80BF823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1669035992; bh=xDOqT6MafeXCA4fI+d3gh6MExRFiiP/KhqOu0acKycE=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=cLhTGrdO+ZQNPlVPhVGOgO9uJz6DykTSHjQtaVfCcD/Is58SU98b+fQqnlcekhKKH jDYARJaPKKNs+tAQWvKFKhp6PkKRuNYSBAsnwHjyhlUxdoyr3L4Wpy4Vqzagxu89tT h9SedCMEWx9s1FqIdjq10yxNDHTIS9K9YgHh3STs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 70EBFF800F3; Mon, 21 Nov 2022 14:05:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38431F8028D; Mon, 21 Nov 2022 14:05:41 +0100 (CET) Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EC8B0F800F3 for ; Mon, 21 Nov 2022 14:05:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EC8B0F800F3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="h1GjlOuJ" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALCHOs4021350; Mon, 21 Nov 2022 13:05:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=B12Jgx6vlRKuMa3MkvoWuhcUaCtEvn2NOcaMR+Bqmig=; b=h1GjlOuJ6CcimigvfXICHuwMYIEa3WzLo5iTrlQ+xJKvR2KMmPslAr/jZw4xGJ6JAIWq ZdeBGLF/OMHtiyFd5O9sITU54H9aASsqrbD09WC+Ufl8Xqp9oGgvgAdxONtTZodEIE8+ tSJxtQ6lwoOX1Wez229IVI4WPAe+MaLqJnBlcscQV2X+i08DM5IgyNdLneMUORmVIWDl nxWQMsvv+l19wv5i8EGXCobeZOWYS1F8zUmqrSM4cfS6iRbdWEUu7UBnIyJdWseNKXX2 63Tv8QVSGudOW18fJYezpvwHkljRLQMv44gqTSEpGNuIIhi1rfs9gx7dqBlTWAk6OnxW RA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kxrf0vkcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 13:05:23 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2ALD5MXg001195 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 13:05:22 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 21 Nov 2022 05:05:16 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , Subject: [PATCH] ASoC: soc-pcm.c: Add NULL check in BE reparenting Date: Mon, 21 Nov 2022 18:34:55 +0530 Message-ID: <1669035895-12036-1-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: _mLjRdFN8d9TJmNWN3kazx4spO0V-gFH X-Proofpoint-ORIG-GUID: _mLjRdFN8d9TJmNWN3kazx4spO0V-gFH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 clxscore=1011 impostorscore=0 mlxlogscore=949 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211210102 Cc: Srinivasa Rao Mandadapu 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" Add NULL check in dpcm_be_reparent API, to handle kernel NULL pointer dereference error. Signed-off-by: Srinivasa Rao Mandadapu --- 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 493f003..a7810c7 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1247,6 +1247,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)