From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Aditya Pakki <pakki001@umn.edu>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 4.4 06/22] drm/radeon: fix multiple reference count leak
Date: Fri, 21 Aug 2020 12:19:58 -0400 [thread overview]
Message-ID: <20200821162014.349506-6-sashal@kernel.org> (raw)
In-Reply-To: <20200821162014.349506-1-sashal@kernel.org>
From: Aditya Pakki <pakki001@umn.edu>
[ Upstream commit 6f2e8acdb48ed166b65d47837c31b177460491ec ]
On calling pm_runtime_get_sync() the reference count of the device
is incremented. In case of failure, decrement the
reference count before returning the error.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/radeon/radeon_connectors.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index bebcef2ce6b88..a9f1d99bb6f99 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -886,8 +886,10 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
}
if (encoder) {
@@ -1021,8 +1023,10 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
}
encoder = radeon_best_single_encoder(connector);
@@ -1158,8 +1162,10 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
}
encoder = radeon_best_single_encoder(connector);
@@ -1241,8 +1247,10 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
}
if (radeon_connector->detected_hpd_without_ddc) {
@@ -1681,8 +1689,10 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
if (!drm_kms_helper_is_poll_worker()) {
r = pm_runtime_get_sync(connector->dev->dev);
- if (r < 0)
+ if (r < 0) {
+ pm_runtime_put_autosuspend(connector->dev->dev);
return connector_status_disconnected;
+ }
}
if (!force && radeon_check_hpd_status_unchanged(connector)) {
--
2.25.1
next prev parent reply other threads:[~2020-08-21 16:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 16:19 [PATCH AUTOSEL 4.4 01/22] ALSA: pci: delete repeated words in comments Sasha Levin
2020-08-21 16:19 ` [PATCH AUTOSEL 4.4 02/22] ASoC: tegra: Fix reference count leaks Sasha Levin
2020-08-21 16:19 ` [PATCH AUTOSEL 4.4 03/22] media: pci: ttpci: av7110: fix possible buffer overflow caused by bad DMA value in debiirq() Sasha Levin
2020-08-21 16:19 ` [PATCH AUTOSEL 4.4 04/22] scsi: target: tcmu: Fix crash on ARM during cmd completion Sasha Levin
2020-08-21 16:19 ` [PATCH AUTOSEL 4.4 05/22] drm/amdkfd: Fix reference count leaks Sasha Levin
2020-08-21 16:19 ` Sasha Levin [this message]
2020-08-21 16:19 ` [PATCH AUTOSEL 4.4 07/22] drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 08/22] drm/amd/display: fix ref count leak in amdgpu_drm_ioctl Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 09/22] drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 10/22] drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 11/22] scsi: lpfc: Fix shost refcount mismatch when deleting vport Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 12/22] selftests/powerpc: Purge extra count_pmc() calls of ebb selftests Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 13/22] PCI: Fix pci_create_slot() reference count leak Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 14/22] rtlwifi: rtl8192cu: Prevent leaking urb Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 15/22] mips/vdso: Fix resource leaks in genvdso.c Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 16/22] drm/nouveau/drm/noveau: fix reference count leak in nouveau_fbcon_open Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 17/22] drm/nouveau: Fix reference count leak in nouveau_connector_detect Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 18/22] locking/lockdep: Fix overflow in presentation of average lock-time Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 19/22] scsi: iscsi: Do not put host in iscsi_set_flashnode_param() Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 20/22] ceph: fix potential mdsc use-after-free crash Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 21/22] scsi: fcoe: Memory leak fix in fcoe_sysfs_fcf_del() Sasha Levin
2020-08-21 16:20 ` [PATCH AUTOSEL 4.4 22/22] EDAC/ie31200: Fallback if host bridge device is already initialized Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200821162014.349506-6-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox