summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2022-12-21 11:30:31 -0800
committerJohn Harrison <John.C.Harrison@Intel.com>2022-12-22 12:42:23 -0800
commit4071d98b296a5bc5fd4b15ec651bd05800ec9510 (patch)
tree7161669c5e0cf5c5e08f56d32a624e832906b4be /drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c
parentd830e0dc2e2d4826ebc6a429c2bc098848c9eeda (diff)
downloadlinux-4071d98b296a5bc5fd4b15ec651bd05800ec9510.tar.gz
linux-4071d98b296a5bc5fd4b15ec651bd05800ec9510.tar.bz2
linux-4071d98b296a5bc5fd4b15ec651bd05800ec9510.zip
drm/i915/uc: Fix two issues with over-size firmware files
In the case where a firmware file is too large (e.g. someone downloaded a web page ASCII dump from github...), the firmware object is released but the pointer is not zerod. If no other firmware file was found then release would be called again leading to a double kfree. Also, the size check was only being applied to the initial firmware load not any of the subsequent attempts. So move the check into a wrapper that is used for all loads. Fixes: 016241168dc5 ("drm/i915/uc: use different ggtt pin offsets for uc loads") Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221221193031.687266-4-John.C.Harrison@Intel.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c')
0 files changed, 0 insertions, 0 deletions