Skip to content

Commit

Permalink
drm/i915: Check input parameter for NULL
Browse files Browse the repository at this point in the history
[why]
i915_gem_object_put_pages_phys() frees pages and standard
pattern is to allow caller to not care if it's
NULL or not. This will reduce burden on
the callers to perform this check.

[how]
Fix it by adding Null check.

Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
  • Loading branch information
hyperlyz authored and intel-lab-lkp committed Feb 21, 2022
1 parent 602e604 commit c54be42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gem/i915_gem_phys.c
Expand Up @@ -95,6 +95,8 @@ void
i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
struct sg_table *pages)
{
if (!pages)
return;
dma_addr_t dma = sg_dma_address(pages->sgl);
void *vaddr = sg_page(pages->sgl);

Expand Down

0 comments on commit c54be42

Please sign in to comment.