summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-10-18 00:08:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-10-18 00:08:24 +0000
commit98776d7b7b2704be8e77417db4400367ccbf771c (patch)
tree503e623ed0e7709e330fbe0325ad71a9709cbd20 /sys/dev
parentf4dc949c28106178ba228d1a7b7db4bdcdd43754 (diff)
drm/i915/hdcp: fix connector refcounting
From Jani Nikula 55f2bd90b9fba95e929d4c407ffc422597152323 in linux-6.6.y/6.6.57 4cc2718f621a6a57a02581125bb6d914ce74d23b in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/i915/display/intel_hdcp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915/display/intel_hdcp.c b/sys/dev/pci/drm/i915/display/intel_hdcp.c
index 197c83f713e..a42e133bc21 100644
--- a/sys/dev/pci/drm/i915/display/intel_hdcp.c
+++ b/sys/dev/pci/drm/i915/display/intel_hdcp.c
@@ -1005,7 +1005,8 @@ static void intel_hdcp_update_value(struct intel_connector *connector,
hdcp->value = value;
if (update_property) {
drm_connector_get(&connector->base);
- queue_work(i915->unordered_wq, &hdcp->prop_work);
+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
+ drm_connector_put(&connector->base);
}
}
@@ -2491,7 +2492,8 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
mutex_lock(&hdcp->mutex);
hdcp->value = DRM_MODE_CONTENT_PROTECTION_DESIRED;
drm_connector_get(&connector->base);
- queue_work(i915->unordered_wq, &hdcp->prop_work);
+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
+ drm_connector_put(&connector->base);
mutex_unlock(&hdcp->mutex);
}
@@ -2508,7 +2510,9 @@ void intel_hdcp_update_pipe(struct intel_atomic_state *state,
*/
if (!desired_and_not_enabled && !content_protection_type_changed) {
drm_connector_get(&connector->base);
- queue_work(i915->unordered_wq, &hdcp->prop_work);
+ if (!queue_work(i915->unordered_wq, &hdcp->prop_work))
+ drm_connector_put(&connector->base);
+
}
}