Commit 62ab420f authored by Insu Yun's avatar Insu Yun Committed by Jani Nikula

i915: correctly handling failed allocation

Since devm_kzalloc can be failed, it needs to be checked
if not, NULL dereference could be happened.
Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1451491169-35068-1-git-send-email-wuninsu@gmail.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent eba51190
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment