lkml.org 
[lkml]   [2016]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] i915: correctly handling failed allocation
Date
On Wed, 30 Dec 2015, Insu Yun <wuninsu@gmail.com> wrote:
> 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>

Pushed to drm-intel-next-queued, thanks for the patch.

BR,
Jani.

> ---
> drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
> index a5e99ac..aa1f7bc 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);

--
Jani Nikula, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2016-01-04 15:21    [W:0.225 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site