]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/xe/display/xe_hdcp_gsc: Free arbiter on driver removal
authorNirmoy Das <nirmoy.das@intel.com>
Mon, 8 Jul 2024 12:59:18 +0000 (14:59 +0200)
committerNirmoy Das <nirmoy.das@intel.com>
Wed, 10 Jul 2024 09:19:56 +0000 (11:19 +0200)
Free arbiter allocated in intel_hdcp_gsc_init().

Fixes: 152f2df954d8 ("drm/xe/hdcp: Enable HDCP for XE")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240708125918.23573-1-nirmoy.das@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c

index 14b8b42783170be1d45eb3bdfd2edc7095d61e01..990285aa9b2612f4dc34e601e365896c84153929 100644 (file)
@@ -160,12 +160,16 @@ void intel_hdcp_gsc_fini(struct xe_device *xe)
 {
        struct intel_hdcp_gsc_message *hdcp_message =
                                        xe->display.hdcp.hdcp_message;
+       struct i915_hdcp_arbiter *arb = xe->display.hdcp.arbiter;
 
-       if (!hdcp_message)
-               return;
+       if (hdcp_message) {
+               xe_bo_unpin_map_no_vm(hdcp_message->hdcp_bo);
+               kfree(hdcp_message);
+               xe->display.hdcp.hdcp_message = NULL;
+       }
 
-       xe_bo_unpin_map_no_vm(hdcp_message->hdcp_bo);
-       kfree(hdcp_message);
+       kfree(arb);
+       xe->display.hdcp.arbiter = NULL;
 }
 
 static int xe_gsc_send_sync(struct xe_device *xe,