From patchwork Wed Dec 12 08:54:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1870031 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 170363FC81 for ; Wed, 12 Dec 2012 18:25:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16A2EE6668 for ; Wed, 12 Dec 2012 10:25:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 68C8CE5C1A for ; Wed, 12 Dec 2012 01:01:17 -0800 (PST) Received: by mail-pb0-f49.google.com with SMTP id un15so362490pbc.36 for ; Wed, 12 Dec 2012 01:01:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=VXBMU/0s2HKT12ZvYqncq8aVFEYxNbOvyHITBcvOibc=; b=P2+c9u2AUm/SOw25nqqF45AWyGvsRAYBod/fqlojNQWiH0fzqJFDNu1M7d28u2o214 ZROKKkOHQgCPSskcVNv5z1Bbb/QvmDDcqPFSqK1sSOWTM4KidAKylHWM5gHm4qpPyDDb Na8t33okKeYAKWoL/0lf8vDNMUt0c8+hrZsbzF1OMsMyXXigcSFI3MTjcukoSVop0na/ iwvgKiqnTusu+PCJjZLUvmPyYGsnlgRojNWzvOwBCmhuvz7uHzK9MNHq3rFJnNKMvf2/ CBkENEtQ3LkO0e3b3K0INW1C4iTtWqUI7m5RhgEarkKBKsIfdw1TPjfMc52PpZk3SEaT YGkg== Received: by 10.66.82.68 with SMTP id g4mr782568pay.9.1355302877266; Wed, 12 Dec 2012 01:01:17 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ip8sm15326855pbc.36.2012.12.12.01.01.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 01:01:16 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/exynos: hdmi: Fix potential NULL pointer dereference error Date: Wed, 12 Dec 2012 14:24:08 +0530 Message-Id: <1355302448-21617-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1355302448-21617-1-git-send-email-sachin.kamat@linaro.org> References: <1355302448-21617-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQn5b45Fs9D15AzxR5+LHrfv1QNtA8IBXoyHEAvzvP4vTk3BFY9kC0eV9hAifU0GAzpSKFmJ X-Mailman-Approved-At: Wed, 12 Dec 2012 08:51:28 -0800 Cc: patches@linaro.org, sachin.kamat@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This is an unlikely case. However to silence the following smatch error add a NULL check: drivers/gpu/drm/exynos/exynos_hdmi.c:2486 hdmi_probe() error: potential NULL dereference 'match'. Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index fdd353d..53244c2 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2483,6 +2483,8 @@ static int __devinit hdmi_probe(struct platform_device *pdev) const struct of_device_id *match; match = of_match_node(of_match_ptr(hdmi_match_types), pdev->dev.of_node); + if (match == NULL) + return -ENODEV; hdata->type = (enum hdmi_type)match->data; } else { hdata->type = (enum hdmi_type)platform_get_device_id