From patchwork Wed Sep 4 11:10:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Sharma X-Patchwork-Id: 13790554 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 27B1ACA0ED3 for ; Wed, 4 Sep 2024 11:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tWlGfHBVtQOmxS9NVYbXksZ8cvR3jgjROa3dS+WJ5xU=; b=rIcLaLU6MtIg/eJwc7gu7dFGUW gdHR4OPM80NfjoL3iJOpSALoPQopEML12mvwyGrVmlNver/auDNvK/yCMbeSO3Yczm/J8TmS8UZ8p yOGGm0usntC55D1rSwx3uWtFqw9+JeJ3V/rTfcfV7Ce/d94yioGHGbNKTM2SJTMCCrWiGB9wh4a9m nYdIYzYgSewQYlX2ZirHIojrcvW8lESin80mEHS7wZPGn3e4CPW0ek+u1qVCjwb8zWUZhQ19eayn4 htx/wow7qB1lCbSyU74t6pqxkZPVMMInGxrEFUrkbHJ37KjQzPv3QXMWBxrHSGVd3YUmudZO7xvCj mbb4DxBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slnyX-000000044ja-1MU1; Wed, 04 Sep 2024 11:15:01 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slnvf-000000043fS-2fHA for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 11:12:04 +0000 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4849vUX6029938; Wed, 4 Sep 2024 11:11:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= tWlGfHBVtQOmxS9NVYbXksZ8cvR3jgjROa3dS+WJ5xU=; b=Hxt8zByhrPSmKOQc y6uLf2Rl5Z+brr32Rio8FzxbUZjsqR3UOvJf2d5jon00/HF4FgdQnT5VJDOiIeVk RzslXBfiyKHJdcSMzt1o8hIbpJbifFAaKFqlkme41di2/Zl6ueJ53gUca+JRcoYp d0c4LWxmB2487nh3K7ZIgwz6P+qewqz/GJGyxIZbSKLbh9zyvuaYRr+Y4CV0xyRL 7ohemALJoxFRMT6D0jYJ0oagTutwruR5wHE+CBvH/HZWBGWkJiLtsds6Op3W9iGm rE1y2NQKoBRdiCZB92rPASFzWo4z66jxwhkpAuLVCq0mghMNiNSKvQkrD8xSg11c 4D79dw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41dxy23wt8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Sep 2024 11:11:55 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 484BBse5002289 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Sep 2024 11:11:54 GMT Received: from [169.254.0.1] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 4 Sep 2024 04:11:48 -0700 From: Vikram Sharma Date: Wed, 4 Sep 2024 16:40:09 +0530 Subject: [PATCH 03/10] media: qcom: camss: Fix potential crash if domain attach fails MIME-Version: 1.0 Message-ID: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-3-b18ddcd7d9df@quicinc.com> References: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-0-b18ddcd7d9df@quicinc.com> In-Reply-To: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-0-b18ddcd7d9df@quicinc.com> To: Robert Foss , Todor Tomov , "Bryan O'Donoghue" , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kapatrala Syed , Hariram Purushothaman , "Bjorn Andersson" , Konrad Dybcio , Hans Verkuil , , Catalin Marinas , Will Deacon CC: , , , , , Vikram Sharma , X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725448289; l=1333; i=quic_vikramsa@quicinc.com; s=20240628; h=from:subject:message-id; bh=Qfo4SG04JA1avzMunJkHpOPgO4ke3s3rGLlQH1I3nyk=; b=wAtJvj1IJ4SSelejjIF4WasEAIO8cqACdGS3sGDSchgU6EypI00JHnGxqFlr+O5l/qCHCI6cq JiO2wdtPtc5AWq42hm0tBC/NBnYTPu5GcaGTBftF8OpQJwhyinmZAyI X-Developer-Key: i=quic_vikramsa@quicinc.com; a=ed25519; pk=vQBkwZr1Hv+VXogAyTAu7AEx8/6bvkOmgrzYFbNGCDI= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cjBJNoG6w3gpnKxVfNv_GfhM86DHbszL X-Proofpoint-ORIG-GUID: cjBJNoG6w3gpnKxVfNv_GfhM86DHbszL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-04_09,2024-09-04_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409040084 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_041203_723337_E56FC81A X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix a potential crash in camss by ensuring detach is skipped if attach is unsuccessful. Fixes: d89751c61279 ("media: qcom: camss: Add support for named power-domains") CC: stable@vger.kernel.org Signed-off-by: Vikram Sharma --- drivers/media/platform/qcom/camss/camss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index d64985ca6e88..447b89d07e8a 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2132,7 +2132,7 @@ static int camss_configure_pd(struct camss *camss) camss->res->pd_name); if (IS_ERR(camss->genpd)) { ret = PTR_ERR(camss->genpd); - goto fail_pm; + goto fail_pm_attach; } } @@ -2149,7 +2149,7 @@ static int camss_configure_pd(struct camss *camss) ret = -ENODEV; else ret = PTR_ERR(camss->genpd); - goto fail_pm; + goto fail_pm_attach; } camss->genpd_link = device_link_add(camss->dev, camss->genpd, DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME | @@ -2164,6 +2164,7 @@ static int camss_configure_pd(struct camss *camss) fail_pm: dev_pm_domain_detach(camss->genpd, true); +fail_pm_attach: return ret; }