drm/amdgpu/display: Unlock mutex on error
authorJohn van der Kamp <sjonny@suffe.me.uk>
Tue, 23 Jun 2020 21:30:54 +0000 (23:30 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jun 2020 22:08:21 +0000 (18:08 -0400)
Make sure we pass through ret label to unlock the mutex.

Signed-off-by: John van der Kamp <sjonny@suffe.me.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

index dcf84a61de37f3b1254da646ec3688c00de3ecbf..949d10ef83040c36df4492fef297e8a49361d11e 100644 (file)
@@ -510,8 +510,10 @@ static ssize_t srm_data_read(struct file *filp, struct kobject *kobj, struct bin
 
        srm = psp_get_srm(work->hdcp.config.psp.handle, &srm_version, &srm_size);
 
-       if (!srm)
-               return -EINVAL;
+       if (!srm) {
+               ret = -EINVAL;
+               goto ret;
+       }
 
        if (pos >= srm_size)
                ret = 0;