drm/amd/display: add missing mod_vmid destructor
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Wed, 29 May 2019 15:24:35 +0000 (11:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 22 Jun 2019 14:34:14 +0000 (09:34 -0500)
mod_vmid is missing a destructor.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/modules/inc/mod_vmid.h
drivers/gpu/drm/amd/display/modules/vmid/vmid.c

index c7672f3b837f59e7af2ff2df21a7becf785b24d9..a3787fdf0c08d674d6a5ac2e7a1038f733572c01 100644 (file)
@@ -41,4 +41,6 @@ struct mod_vmid *mod_vmid_create(
                unsigned int num_vmid,
                struct dc_virtual_addr_space_config *va_config);
 
+void mod_vmid_destroy(struct mod_vmid *mod_vmid);
+
 #endif /* MOD_VMID_H_ */
index 431052626d93287ed527c1b8cb873f1f30938d75..f0a153704f6e0cde214f93d777a00fca29b5c4fc 100644 (file)
@@ -156,3 +156,12 @@ fail_alloc_context:
 fail_dc_null:
        return NULL;
 }
+
+void mod_vmid_destroy(struct mod_vmid *mod_vmid)
+{
+       if (mod_vmid != NULL) {
+               struct core_vmid *core_vmid = MOD_VMID_TO_CORE(mod_vmid);
+
+               kfree(core_vmid);
+       }
+}