Skip to content

Commit 1b1b116

Browse files
committed
drm/i915: Free write_buf that we allocated with kzalloc.
We use kzalloc to allocate the write_buf that we use for i2c transfer on hdcp write. But it seems that we are forgetting to free the memory that is not needed after i2c transfer is completed. Reported-by: Brian J Wood <[email protected]> Fixes: 2320175 ("drm/i915: Implement HDCP for HDMI") Cc: Ramalingam C <[email protected]> Cc: Sean Paul <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: <[email protected]> # v4.17+ Signed-off-by: Rodrigo Vivi <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 62d3a8d) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 5b2695f commit 1b1b116

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/gpu/drm/i915/intel_hdmi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,12 @@ static int intel_hdmi_hdcp_write(struct intel_digital_port *intel_dig_port,
943943

944944
ret = i2c_transfer(adapter, &msg, 1);
945945
if (ret == 1)
946-
return 0;
947-
return ret >= 0 ? -EIO : ret;
946+
ret = 0;
947+
else if (ret >= 0)
948+
ret = -EIO;
949+
950+
kfree(write_buf);
951+
return ret;
948952
}
949953

950954
static

0 commit comments

Comments
 (0)