diff mbox

i915: correctly handling failed allocation

Message ID 1451415713-9508-1-git-send-email-wuninsu@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Insu Yun Dec. 29, 2015, 7:01 p.m. UTC
Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Insu Yun Dec. 30, 2015, 3:56 p.m. UTC | #1
On Wed, Dec 30, 2015 at 4:16 AM, Jani Nikula <jani.nikula@linux.intel.com>
wrote:

> 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;
>

Oh sorry. There was a type.


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

Yes. Sorry.


>
> BR,
> Jani.
>
>
> >
> >       vbt_panel->intel_dsi = intel_dsi;
> >       drm_panel_init(&vbt_panel->panel);
>
> --
> Jani Nikula, Intel Open Source Technology Center
>
diff mbox

Patch

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);