]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/amd/display: Initialize attribute for hdcp_srm sysfs file
authorDavid Ward <david.ward@gatech.edu>
Mon, 10 May 2021 09:30:39 +0000 (05:30 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 09:07:26 +0000 (11:07 +0200)
BugLink: https://bugs.launchpad.net/bugs/1931292
commit fe1c97d008f86f672f0e9265f180c22451ca3b9f upstream.

It is stored in dynamically allocated memory, so sysfs_bin_attr_init() must
be called to initialize it. (Note: "initialization" only sets the .attr.key
member in this struct; it does not change the value of any other members.)

Otherwise, when CONFIG_DEBUG_LOCK_ALLOC=y this message appears during boot:

    BUG: key ffff9248900cd148 has not been registered!

Fixes: 9037246bb2da ("drm/amd/display: Add sysfs interface for set/get srm")
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1586
Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: David Ward <david.ward@gatech.edu>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

index 79de68ac03f20724e44ff75df1aa871845e48d41..0c3b15992b8147bd15b8fe485ff90c0c3176bcd1 100644 (file)
@@ -643,6 +643,7 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
 
        /* File created at /sys/class/drm/card0/device/hdcp_srm*/
        hdcp_work[0].attr = data_attr;
+       sysfs_bin_attr_init(&hdcp_work[0].attr);
 
        if (sysfs_create_bin_file(&adev->dev->kobj, &hdcp_work[0].attr))
                DRM_WARN("Failed to create device file hdcp_srm");