Skip to content

Commit

Permalink
i915: correctly handling failed allocation
Browse files Browse the repository at this point in the history
Since devm_kzalloc can be failed, it needs to be checked
if not, NULL dereference could be happened.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1451491169-35068-1-git-send-email-wuninsu@gmail.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
  • Loading branch information
Insu Yun authored and Jani Nikula committed Jan 4, 2016
1 parent eba5119 commit 62ab420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)

/* This is cheating a bit with the cleanup. */
vbt_panel = devm_kzalloc(dev->dev, sizeof(*vbt_panel), GFP_KERNEL);
if (!vbt_panel)
return NULL;

vbt_panel->intel_dsi = intel_dsi;
drm_panel_init(&vbt_panel->panel);
Expand Down

0 comments on commit 62ab420

Please sign in to comment.