Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1299086 > unrolled thread

[PATCH] i915: correctly handling failed allocation

Started byInsu Yun <wuninsu@gmail.com>
First post2015-12-29 20:00 +0100
Last post2015-12-30 10:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i915: correctly handling failed allocation Insu Yun <wuninsu@gmail.com> - 2015-12-29 20:00 +0100
    Re: [PATCH] i915: correctly handling failed allocation Jani Nikula <jani.nikula@linux.intel.com> - 2015-12-30 10:20 +0100

#1299086 — [PATCH] i915: correctly handling failed allocation

FromInsu Yun <wuninsu@gmail.com>
Date2015-12-29 20:00 +0100
Subject[PATCH] i915: correctly handling failed allocation
Message-ID<qL7EZ-4gU-9@gated-at.bofh.it>
Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 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..4e279dd 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_pannel)
+		return NULL;
 
 	vbt_panel->intel_dsi = intel_dsi;
 	drm_panel_init(&vbt_panel->panel);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1299277

FromJani Nikula <jani.nikula@linux.intel.com>
Date2015-12-30 10:20 +0100
Message-ID<qLl5g-4Hy-5@gated-at.bofh.it>
In reply to#1299086
On Tue, 29 Dec 2015, Insu Yun <wuninsu@gmail.com> wrote:
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> ---
>  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..4e279dd 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_pannel)
> +		return NULL;

We have build bots and CI, but the least you must do is build the code
you change before submitting patches.

BR,
Jani.


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

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web