From patchwork Wed Dec 15 11:49:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12691924 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 12766C433F5 for ; Wed, 15 Dec 2021 11:49:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242166AbhLOLtX (ORCPT ); Wed, 15 Dec 2021 06:49:23 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:63270 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236958AbhLOLtW (ORCPT ); Wed, 15 Dec 2021 06:49:22 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BFBSuet028543; Wed, 15 Dec 2021 11:49:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=kCLJlGeKm5XEiPIh0XtP3dohzdyA0M6MUtd0BRzJw2s=; b=f1UMYOrSMwto9h1KJ+kGRiBorHWSubefyKIvBT4SBTrUVP2bfU7pVGq+17erN9qSwW6K L8toVYmQGSPLPRRnUfwQpWLEnFp1wl1dnhcphVMuhXt7pvuLzUxS5j9cD/XYb4zKaAmH oz2GNGTB9KnhnaMsvEuIy/HeCoVZQUrx4KVhsCFbDfu925vkH+vMEdni6QjRi7UCWmAV zag2AmpBqCICVhoKa052QrlLFXmzEF80f9GFhawCn862AzyYBlDlGXVhC7dhojcu/XPn zIZq8Cfvdog6996W4AV0CVnw+MptTfGfLWp1Dps/FpFIOUJERSCm1paFWrqJJwNuWr8J PQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3cx3ukek15-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 11:49:17 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BFBg5t7154807; Wed, 15 Dec 2021 11:49:17 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2174.outbound.protection.outlook.com [104.47.73.174]) by aserp3030.oracle.com with ESMTP id 3cvj1fa72y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Dec 2021 11:49:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K8Ez8mgtopWH98ZAO561e/KeJLI86ww5LCiTcgcTC6THb97SVpKzujfeCAJJl+EULj7jje/iUTTF24z6Ec3sgdEOf9Z85v8gdQ0VgrybxOdkGPze641w8gHjotglyWWVJdu8Qs65cKaQcTF+l/8gu82UUrQJOU2cuwnq2KCp1tNk6/9r/xBXviEPltplCFL/PrCxy0srGSdbrWOwpOdlF+WYmb+cy8GJJ7AhvVwM8sj4j8sJ1SagOug6ZzLLnsFCV3/NYMFozTt6LFW+zA9Trt6FzJirOS6P4lZqk2AI3jJbQXnJzhvX/LUElXTvxIR3NtURjkEgPRbyyxAEsEz+oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kCLJlGeKm5XEiPIh0XtP3dohzdyA0M6MUtd0BRzJw2s=; b=TVJxDBslCAB3zfSvQScZ5zddIRJES2aFmhgSWak3gOSJ0E3liqaxKN8cW0gpAF8or5BfBvtp91aqowPx3Uq5W/9rzASv0DTiJ8OHTNbbhiMGqt16DHIPR6UAy+fhkR1RjnSyEIkZNN+4P6XCiIen8UqgWHJvqIqJIATtAvgKARdat6pRCdlEK6RakiWosnYYR2L7FwWDODwCMtxkVxDZGb4hQb9rXWk9BATPBzaEho3hAwdNk/NmJmRwgLDdkSeFv7J8gjfXkhI3jVLZXGmTwBIKsybLhj9h9VYB4imI0xKo3BBmpCihiHrWN5xuJnHNLaWQNG1oDu+YvJnOI/4jIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kCLJlGeKm5XEiPIh0XtP3dohzdyA0M6MUtd0BRzJw2s=; b=Bd2ghvTx5OCYekv0gyjRSSEq/5aA4gvwyhOd6wu5LP6ONqBCClvM41qt12tMu9ksQgzPgnU6xAvU01gzUVbGUDQTCwq/lneiRr417LR4XbT3Yg4jstZ8PPdOexBNbI40ClejtHN783HkSO6iHb9eagPl5yc3eZR9TW+tgJDGAiw= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by MWHPR10MB1664.namprd10.prod.outlook.com (2603:10b6:301:9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.18; Wed, 15 Dec 2021 11:49:15 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::7194:c377:36cc:d9f0]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::7194:c377:36cc:d9f0%6]) with mapi id 15.20.4801.014; Wed, 15 Dec 2021 11:49:15 +0000 Date: Wed, 15 Dec 2021 14:49:01 +0300 From: Dan Carpenter To: Rob Clark , Kuogee Hsieh Cc: Sean Paul , Abhinav Kumar , David Airlie , Daniel Vetter , Stephen Boyd , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/msm/dp: Fix double free on error in msm_dp_bridge_init() Message-ID: <20211215114900.GD14552@kili> Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: ZR0P278CA0136.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::15) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbff2a61-7a30-458c-87b8-08d9bfc0eafb X-MS-TrafficTypeDiagnostic: MWHPR10MB1664:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k5CIXs8SotImzWn6BjeJhMHJethpRpuDIKtRgdZAGuKnaNi5qcUpcJiwzJN/VQtOGCkYT5plJamj2H6yxzIySLeldWg3JXYG4pbtUZJ02I3z6r3fXwqnYm2dWIpyRe4lmXmCgknSS2Aq5Vs7+3JvnrDxHCAdNRFwqo5VE3tRxX738Ub+mL6E4IcBNzKhcfPdZVu8TImQmAC8chIraxcnKUTuFjK2vLa+3cPRO5u7UaZZljCjNw9+EYITgSJNbArkBjA1mCPsBhOLFqX/LUzPapeAESXQnUgJvYl5CSAshCd/XR2g9DSlvzr//irh3iGpn4j8KC0VFA2MIxYCkyGCHgVQJ3CoErDK5womUsLUh8+FLCXgltflzuVT9AajQae9OGuEtAFIoTxrM+iVCXNlPGjMHhzWtDXNTTbT2zSsHk2r5hpcf4U6H1ElZKYVDWQnhKLsEyUaIuYkqmfBwDoGBiLRiUGWhADlZkk/TL/xv9ZkW1Fp1GYWEhzYsCq19cp2KMjdGxe9pOuc1z4pXsxZ0nhbJ5b3t+YsdOEcDRXYyRdxom+AfJpDouYCxwIPBnZREQd/nm5EnsuKBB3tGpMsAOKzZUdjJQFCrT5PsFmZkWRDnoImgKrA+MYoh4iFDaJLRubuxDDZYfoJg811bOdHifpxhqJ8oFGhftUQvgKqdBUfwA9lTXRdDxgixPCoTjgZ62kqnUwZjyeLrC3zwqq82g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(7916004)(366004)(38100700002)(6512007)(9686003)(4326008)(38350700002)(26005)(66946007)(6666004)(33716001)(44832011)(8676002)(66476007)(66556008)(5660300002)(86362001)(54906003)(1076003)(2906002)(110136005)(4744005)(8936002)(52116002)(83380400001)(508600001)(6506007)(6486002)(7416002)(186003)(33656002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dZQ3PnfOp2XvWgdwNqff0qG6tC8BMh1FQr+SpfTQ1NIn8sL3dIPU5/dScAd4meFtpPOslFDl2RArMSyUA0GVNfiyd/DdpuXkA4vbvrdbGPr4hn1vP9rJA9wRjpybsKlmVWJ5E+JxzHD8tD+H7J0JdbU4TXp1FHj25M8fUL0FIF2mWznw+OvybZ0cbWJLQUBB5FN10YpLY7iaMyYAZQF58e9DAdPhUKR5qyfjGSrN1SwrrpcEVmwFY42NJSvYBwOQsgFfncpa9XHyr1ZV1ecg2VXtNkslMq0WQFwbDyLQRAmhesEc16sWOCJeq7Vt5WNZQ2Em6oGgFcyrSa0SFJ8PLZScztr2B+9Pe1F1LxpUhn24Y/6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HMVFHkJmSFXDNcexQiAyluIHMC53XBZl3TqNQCImzvlq9dgA66r3S05b77SOhA9HPW7k0vDo7sS1hUN0bZy+NsGrkqB6ua4PkY3Sy4Ol5cNWg0aDBPBQ7ghNku16wzvwnWVbl1/YM5bKf0vKT5Sh+18Y9bbmrvE3dOG+L6fataSl9D4UxCWFBYxaGpwYrXEjctS36AzVESTOsG2KAvsmF9w3geFykfqn4jBRhYvIMQS1ZnYG1Ry9Uj3gg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbff2a61-7a30-458c-87b8-08d9bfc0eafb X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 11:49:15.0732 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8hyBz2i2OMYAecVr3/V0vMJtldzyxQQUMSi89qYt5XixkMZF2qK5lNEgivSmuP2NWgVbl0OSqufp34M2QFD3mp8P/lil7sPJXciRCtepamo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1664 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10198 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112150065 X-Proofpoint-GUID: X3IE-xODy5KVqjc7umG5BLJqkBfqe42y X-Proofpoint-ORIG-GUID: X3IE-xODy5KVqjc7umG5BLJqkBfqe42y Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The "dp_bridge" pointer is allocated with devm_kzalloc() so it will be freed automatically. Kfreeing it here will only lead to a double free. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_drm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 188e77c59885..d4d360d19eba 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -243,7 +243,6 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc) { DRM_ERROR("failed to attach bridge, rc=%d\n", rc); - kfree(dp_bridge); return ERR_PTR(rc); }