projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51239bb
)
UPSTREAM: drm/mm: avoid possible null pointer dereference
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Wed, 18 May 2016 20:17:19 +0000
(22:17 +0200)
committer
Huang, Tao
<huangtao@rock-chips.com>
Tue, 3 Jan 2017 06:11:34 +0000
(14:11 +0800)
Do not dereference node before the check if node is NULL.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link:
http://patchwork.freedesktop.org/patch/msgid/1463602639-4861-1-git-send-email-xypron.glpk@gmx.de
(cherry picked from commit
b80d3942329dcd43580adc3f7c0a098515b5feec
)
Change-Id: I672ce10214e1268a043e6a11268ff400024cc883
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/drm_mm.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/drm_mm.c
b/drivers/gpu/drm/drm_mm.c
index 04de6fd88f8c3a7f5d503c45768582a10a71efd4..cb39f45d6a16befdc9cfac339d1703a2d9a217e5 100644
(file)
--- a/
drivers/gpu/drm/drm_mm.c
+++ b/
drivers/gpu/drm/drm_mm.c
@@
-179,12
+179,14
@@
static void drm_mm_insert_helper(struct drm_mm_node *hole_node,
int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node)
{
struct drm_mm_node *hole;
- u64 end
= node->start + node->size
;
+ u64 end;
u64 hole_start;
u64 hole_end;
BUG_ON(node == NULL);
+ end = node->start + node->size;
+
/* Find the relevant hole to add our node to */
drm_mm_for_each_hole(hole, mm, hole_start, hole_end) {
if (hole_start > node->start || hole_end < end)