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>
Wed, 1 Jul 2020 05:59:26 +0000 (01:59 -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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

index a8ee42d3091152cb9646a12961e9af05148a9d9c..694c5bc93665b6378b90f2a8f597cb76a753873a 100644 (file)
@@ -546,8 +546,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;