Skip to content

Commit

Permalink
drm/i915: Do kunmap if renderstate parsing fails
Browse files Browse the repository at this point in the history
Kunmap the renderstate page on error path.

Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Mika Kuoppala authored and Daniel Vetter committed Jul 21, 2015
1 parent 2617268 commit dd72bde
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/gpu/drm/i915/i915_gem_render_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ static int render_state_setup(struct render_state *so)
s = lower_32_bits(r);
if (so->gen >= 8) {
if (i + 1 >= rodata->batch_items ||
rodata->batch[i + 1] != 0)
return -EINVAL;
rodata->batch[i + 1] != 0) {
ret = -EINVAL;
goto err_out;
}

d[i++] = s;
s = upper_32_bits(r);
Expand All @@ -120,6 +122,10 @@ static int render_state_setup(struct render_state *so)
}

return 0;

err_out:
kunmap(page);
return ret;
}

void i915_gem_render_state_fini(struct render_state *so)
Expand Down

0 comments on commit dd72bde

Please sign in to comment.