From: Lyude Paul <lyude@redhat.com>
To: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: "Thierry Reding" <treding@nvidia.com>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/2] drm/tegra: Fix DP AUX channel reference leaks
Date: Fri, 23 Apr 2021 14:21:46 -0400 [thread overview]
Message-ID: <20210423182146.185633-3-lyude@redhat.com> (raw)
In-Reply-To: <20210423182146.185633-1-lyude@redhat.com>
Noticed while fixing the regression I introduced in Tegra that Tegra seems
to actually never release the device or module references it's grabbing for
the DP AUX channel. So, let's fix that by dropping them when appropriate.
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
drivers/gpu/drm/tegra/sor.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 4e0e3a63e586..474586e18d06 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3772,12 +3772,13 @@ static int tegra_sor_probe(struct platform_device *pdev)
err = tegra_sor_parse_dt(sor);
if (err < 0)
- return err;
+ goto put_aux;
err = tegra_output_probe(&sor->output);
- if (err < 0)
- return dev_err_probe(&pdev->dev, err,
- "failed to probe output\n");
+ if (err < 0) {
+ err = dev_err_probe(&pdev->dev, err, "failed to probe output\n");
+ goto put_aux;
+ }
if (sor->ops && sor->ops->probe) {
err = sor->ops->probe(sor);
@@ -3966,6 +3967,11 @@ static int tegra_sor_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
remove:
tegra_output_remove(&sor->output);
+put_aux:
+ if (sor->aux && sor->output.ddc) {
+ module_put(sor->aux->dev->driver->owner);
+ put_device(sor->aux->dev);
+ }
return err;
}
@@ -3985,6 +3991,11 @@ static int tegra_sor_remove(struct platform_device *pdev)
tegra_output_remove(&sor->output);
+ if (sor->aux && sor->output.ddc) {
+ module_put(sor->aux->dev->driver->owner);
+ put_device(sor->aux->dev);
+ }
+
return 0;
}
--
2.30.2
prev parent reply other threads:[~2021-04-23 18:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 18:21 [PATCH 0/2] drm/tegra: Fix device/module refs for DP Lyude Paul
2021-04-23 18:21 ` [PATCH 1/2] drm/tegra: Get ref for DP AUX channel, not its ddc adapter Lyude Paul
2021-04-26 7:42 ` Thierry Reding
2021-04-27 22:44 ` Lyude Paul
2021-05-14 22:13 ` [PATCH v2] " Lyude Paul
2021-04-23 18:21 ` Lyude Paul [this message]
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=20210423182146.185633-3-lyude@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=treding@nvidia.com \
--cc=ville.syrjala@linux.intel.com \
/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