forked from Minki/linux
drm/i915: fix NULL deref in the load detect code
Looks like I've missed one of the potential NULL deref bugs in Jesse's
fbdev->fb embedded struct to pointer conversions. Fix it up.
This regression has been introduced in
commit 8bcd45534d
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date: Fri Feb 7 12:10:38 2014 -0800
drm/i915: alloc intel_fb in the intel_fbdev struct
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
8ea99c9287
commit
4c0e552882
@ -7754,12 +7754,14 @@ mode_fits_in_fbdev(struct drm_device *dev,
|
||||
struct drm_i915_gem_object *obj;
|
||||
struct drm_framebuffer *fb;
|
||||
|
||||
if (dev_priv->fbdev == NULL)
|
||||
if (!dev_priv->fbdev)
|
||||
return NULL;
|
||||
|
||||
if (!dev_priv->fbdev->fb)
|
||||
return NULL;
|
||||
|
||||
obj = dev_priv->fbdev->fb->obj;
|
||||
if (obj == NULL)
|
||||
return NULL;
|
||||
BUG_ON(!obj);
|
||||
|
||||
fb = &dev_priv->fbdev->fb->base;
|
||||
if (fb->pitches[0] < intel_framebuffer_pitch_for_width(mode->hdisplay,
|
||||
|
Loading…
Reference in New Issue
Block a user