Skip to content

Commit 62ab420

Browse files
insuyunjnikula
authored andcommitted
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 <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Jani Nikula <[email protected]>
1 parent eba5119 commit 62ab420

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/i915/intel_dsi_panel_vbt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,8 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
666666

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

670672
vbt_panel->intel_dsi = intel_dsi;
671673
drm_panel_init(&vbt_panel->panel);

0 commit comments

Comments
 (0)