Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp860782pxb; Tue, 1 Feb 2022 11:58:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY4onhzqlotJTMy+qnFroigiN/8BHyegS+c6e7lf9foS8ag2BZcQy6mWIlFPuKXqsZXX8k X-Received: by 2002:a17:90b:4d05:: with SMTP id mw5mr4128192pjb.218.1643745493937; Tue, 01 Feb 2022 11:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745493; cv=none; d=google.com; s=arc-20160816; b=FKZ0/NmseEy2HVMwWw9D3DQXGERNj3IYbDxOeLXYn02MXRZsrns46h4K2ZSt1g3I+U bSAceirDrYQGk9wu1yKBe3sD3EfmwKo7TbOn8QtOGTkbCUvm74fHs0VS8l0avVzk5krk PEN4Y/ww3Wmf/ofIbso1K6NB8zIr6hpMdiPDldWG02ecdt6vJzyXju5dxClrs1ixk76Z ySAi503Nu+0LhOBIq1lmTUAtJsWcXvDiS+jeVme8/Xnqtfv7bombY4ggX5xiu/YeoZgp jtuMfQDGUM5jOwmPWobheUXcPU58AUkm3hsLWwbV5VRiI9vDClhkI4WpsY9p2j3hXZ7H kZsw== 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=pW94PYluO4RJpvUAMd2L3oVC+Id1/5/ZrDrsbwtR35tfZrUDLVSJOnDzmes84HgG8g M01lPolvuFuM2sScINp6/rvxMhVC8KGGzZw9oiE6AgFH1ujoAO1O/DCa80/SvMgP9heV pkpOrg3ReZ9PYU+xyFn3ciXn0x4F7iuUc6/wb+acsLD9N5+RdSELggA9QpLz3n36mW7c adZyqEO0TED8S0TKDtbtJdFZbVEsLErPxyIRIGon3EanYw3qRjwHKX7o/3TL0KDUSHbr xnpDiqqwVG9n7GNcZBcindlzQIarLnUrxD2/qoLfSsNFwhh7muUcXmofpWvkocfKNMTL soGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OalX7Tuz; 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 l15si19023043plh.32.2022.02.01.11.58.01; Tue, 01 Feb 2022 11:58:13 -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=OalX7Tuz; 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 S1359846AbiAaLIB (ORCPT + 99 others); Mon, 31 Jan 2022 06:08:01 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52380 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348720AbiAaLE3 (ORCPT ); Mon, 31 Jan 2022 06:04:29 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id 195CFB82A6A; Mon, 31 Jan 2022 11:04:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FF9DC340E8; Mon, 31 Jan 2022 11:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627066; bh=yvLfEvfM1S9QsM+cfwQvHnI2a+N1nMMw0orbNRBlg70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OalX7TuzZJS31C/q0j6S7L0y2RdnmoERvSVQ/ZcCONrD044hb/6JSMFxeyv0/9hSI H98xKYv1RVAgDMwkkiWDWk4mKM9piNDYmYJaO8GDzHKl8Fq2Ne/Exy5b5FyUOud7n8 CGD7xe+GCnBzgonBZqFCuUxdEB5rsdcRNlb0xv70= 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.10 063/100] drm/msm/dsi: Fix missing put_device() call in dsi_get_phy Date: Mon, 31 Jan 2022 11:56:24 +0100 Message-Id: <20220131105222.554006644@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@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; }