Skip to content

Commit

Permalink
qxl: check for kmap failures
Browse files Browse the repository at this point in the history
If kmap fails, it leads to memory corruption.

Fixes: f64122c ('drm: add new QXL driver. (v1.4)')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160711084633.GA31411@mwanda
  • Loading branch information
Dan Carpenter authored and danvet committed Jul 12, 2016
1 parent fb001df commit f4cceb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/qxl/qxl_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ static int qxl_palette_create_1bit(struct qxl_bo *palette_bo,
* correctly globaly, since that would require
* tracking all of our palettes. */
ret = qxl_bo_kmap(palette_bo, (void **)&pal);
if (ret)
return ret;
pal->num_ents = 2;
pal->unique = unique++;
if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) {
Expand Down

0 comments on commit f4cceb2

Please sign in to comment.