From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbcADOGe (ORCPT ); Mon, 4 Jan 2016 09:06:34 -0500 Received: from mga09.intel.com ([134.134.136.24]:12962 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbcADOGc (ORCPT ); Mon, 4 Jan 2016 09:06:32 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,520,1444719600"; d="scan'208";a="885970626" From: Jani Nikula To: Insu Yun , daniel.vetter@intel.com, airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu, changwoo@gatech.edu, Insu Yun Subject: Re: [PATCH v2] i915: correctly handling failed allocation In-Reply-To: <1451491169-35068-1-git-send-email-wuninsu@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <1451491169-35068-1-git-send-email-wuninsu@gmail.com> User-Agent: Notmuch/0.21+33~g570c0ae (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 04 Jan 2016 16:06:03 +0200 Message-ID: <87wprp8mno.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Dec 2015, Insu Yun wrote: > Since devm_kzalloc can be failed, it needs to be checked > if not, NULL dereference could be happened. > > Signed-off-by: Insu Yun 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