Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp859274pxb; Tue, 1 Feb 2022 11:55:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBlLRlLb6ftclSsULl09mMQtV8gmmm3Ic7ezgT8F6qN8aLAhzFrMK74dGsQYPXaVy1DnQe X-Received: by 2002:a05:6402:42d4:: with SMTP id i20mr27160367edc.306.1643745348044; Tue, 01 Feb 2022 11:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745348; cv=none; d=google.com; s=arc-20160816; b=zHq8jxOv3hrWHal0GE3al36vqalZ8NZnwSOHbMWYEcF+UgZODuTQt/vDKpSOgscUCI y6HCIBvmz3246h5hpFwFIvJ0ju+MJVvoYBsha+IKj7VBhK2bJK4zn/XrXFO7by/9uNRh jbkfePcu/+1rCL+n7Ti8v0ypVIL1SBEwRU/UteSGxZ2Pwb8W1gfZdOhexvwbDGjRLrVn RIdwzByNXDXO040E2WmMAeaT2e6qf4wcJYT5aqxHtUdtvvuq8TZaKH0ZviAbPrQMzcKo E0xnSZ+2/DrsbGjNl0BeNF46J5ffHD1/HWEl18s6urYIZTk5Z54AIYYS8MUmXrTY3lTO MmwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WyexXZVwAtZC9LlBEYVVeZ1vk0bff5H5u/4SgVJnFAE=; b=W2Hu8mSGalL5B/OBql8a4NykFeME06bSjDr885fE1ePMkIHfTQGzFqu2xPKugOC+EE bf4Ei/azDY/JA4Usu/xWI9D9GcH9Tu5+7BbO5T5tn4j3zzQzyUOkewbegAP6jsPdLfs0 aU9Z3IiS488NtRp1nRqYtfXqfw8fTVpTjRShfLOUIZKxuMgEYOLKOTMpqWAIm9Y314uC WxYcioZpiZBUEypxhk8ui8Hpdfk6gnh39ykLrukPdVmK7jek8Ocdi23TYOO9ubS6L3iV HYkFqjhoPC7FYFavucRQ5Fsdasbx7iS7/EyBw1UvsPBwA2vbh5pBIjbD5TfjVzg9YhBE TtDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M3AnDFXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz44si6987496ejc.994.2022.02.01.11.55.22; Tue, 01 Feb 2022 11:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M3AnDFXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359159AbiAaLEc (ORCPT + 99 others); Mon, 31 Jan 2022 06:04:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359135AbiAaLDB (ORCPT ); Mon, 31 Jan 2022 06:03:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55AE1C06137E; Mon, 31 Jan 2022 03:01:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EAC4660B2D; Mon, 31 Jan 2022 11:01:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAA68C340E8; Mon, 31 Jan 2022 11:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643626886; bh=yvLfEvfM1S9QsM+cfwQvHnI2a+N1nMMw0orbNRBlg70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3AnDFXea3VB0ZgIy8XR6MIY8RmJM4jChf/nrWFisqMF8GoiCr9WxrvEU1Iz9loz1 Q1n5OiDU2aX/KczyuxjtZ60tXcEsWAp6t4AN7FVddatqtxH2H4iEigOch0tEH3b+rH pSCCu3HCasAnTqjGlw/UAs1pIW1f2WBWmvhVKOxQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Baryshkov Subject: [PATCH 5.4 44/64] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy Date: Mon, 31 Jan 2022 11:56:29 +0100 Message-Id: <20220131105217.168931203@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105215.644174521@linuxfoundation.org> References: <20220131105215.644174521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin commit c04c3148ca12227d92f91b355b4538cc333c9922 upstream. If of_find_device_by_node() succeeds, dsi_get_phy() doesn't a corresponding put_device(). Thus add put_device() to fix the exception handling. Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211230070943.18116-1-linmq006@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/dsi/dsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -33,7 +33,12 @@ static int dsi_get_phy(struct msm_dsi *m of_node_put(phy_node); - if (!phy_pdev || !msm_dsi->phy) { + if (!phy_pdev) { + DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); + return -EPROBE_DEFER; + } + if (!msm_dsi->phy) { + put_device(&phy_pdev->dev); DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); return -EPROBE_DEFER; }