mirror of https://gitee.com/openkylin/linux.git
qxl: check for kmap failures
If kmap fails, it leads to memory corruption.
Fixes: f64122c1f6
('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
This commit is contained in:
parent
fb001dfd7e
commit
f4cceb2aff
|
@ -136,6 +136,8 @@ static int qxl_palette_create_1bit(struct qxl_bo *palette_bo,
|
||||||
* correctly globaly, since that would require
|
* correctly globaly, since that would require
|
||||||
* tracking all of our palettes. */
|
* tracking all of our palettes. */
|
||||||
ret = qxl_bo_kmap(palette_bo, (void **)&pal);
|
ret = qxl_bo_kmap(palette_bo, (void **)&pal);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
pal->num_ents = 2;
|
pal->num_ents = 2;
|
||||||
pal->unique = unique++;
|
pal->unique = unique++;
|
||||||
if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) {
|
if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) {
|
||||||
|
|
Loading…
Reference in New Issue