From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758476AbcIWKwx (ORCPT ); Fri, 23 Sep 2016 06:52:53 -0400 Received: from mail.rapiddevelopmentkit.de ([217.6.246.34]:33235 "EHLO root.phytec.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755168AbcIWKww (ORCPT ); Fri, 23 Sep 2016 06:52:52 -0400 From: Daniel Schultz To: jsarha@ti.com, dri-devel@lists.freedesktop.org Cc: tomi.valkeinen@ti.com, airlied@linux.ie, linux-kernel@vger.kernel.org Subject: [PATCH] drm/tilcdc: fix wrong error handling Date: Fri, 23 Sep 2016 12:52:49 +0200 Message-Id: <1474627969-21859-1-git-send-email-d.schultz@phytec.de> X-Mailer: git-send-email 1.9.1 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP5 HF413|March 21, 2016) at 23.09.2016 12:52:49, Serialize by Router on Idefix/Phytec(Release 9.0.1FP5 HF413|March 21, 2016) at 23.09.2016 12:52:49, Serialize complete at 23.09.2016 12:52:49 X-TNEFEvaluated: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When 'component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist. This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below. Signed-off-by: Daniel Schultz --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index d278093..d491610 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -315,13 +315,13 @@ fail_irq_uninstall: fail_vblank_cleanup: drm_vblank_cleanup(dev); -fail_mode_config_cleanup: - drm_mode_config_cleanup(dev); - fail_component_cleanup: if (priv->is_componentized) component_unbind_all(dev->dev, dev); +fail_mode_config_cleanup: + drm_mode_config_cleanup(dev); + fail_external_cleanup: tilcdc_remove_external_encoders(dev); -- 1.9.1