summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
diff options
context:
space:
mode:
authorInsu Yun <wuninsu@gmail.com>2015-12-30 10:59:29 -0500
committerJani Nikula <jani.nikula@intel.com>2016-01-04 16:05:27 +0200
commit62ab420f7458feb4ef1fa2ef094ee00af9844253 (patch)
tree4c9d2fcd316090963923376b2a2415ab31aa2bbe /drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
parenteba51190f3c6ffcb685fc100a4234095b0146150 (diff)
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: 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>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dsi_panel_vbt.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_panel_vbt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index a5e99ac305da..aa1f7bc8f4d0 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -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);