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: 13489 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 172CD23FCE for ; Wed, 12 Dec 2012 09:01:19 +0000 (UTC) Received: from mail-ia0-f171.google.com (mail-ia0-f171.google.com [209.85.210.171]) by fiordland.canonical.com (Postfix) with ESMTP id BA5B7A192BB for ; Wed, 12 Dec 2012 09:01:18 +0000 (UTC) Received: by mail-ia0-f171.google.com with SMTP id k27so669450iad.2 for ; Wed, 12 Dec 2012 01:01:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=VXBMU/0s2HKT12ZvYqncq8aVFEYxNbOvyHITBcvOibc=; b=acRBhgh0eLE5Ocv1nZC9umQkPd7pw1efC2Q+cJz8DzitRlbhdxxTkK9EIhNFoti+qm iw8uuQima4lwleENw76mOn8Mgt0s8mt3fw/Du6/WhFPAoSODuNRgUqqk+Is7r3RlHHEj YNsTQyCg8YfH4I8EfVRmyUBP18sV8hI2nedLZxVXmfl2srYI1OgsA+14yKuEA7IzR+fs lzFv7qbecU0ieXA10HMB2sNBVoBVfpxXLXnMTNDOZvSD3NC92fsVFx6aJpldYn9RvyUr BUmoKNPk2kvycQE97MDTfuwuVXsNa3Ud3PT/eJ63Vnj6MtjqRF7dK3H6NIOkKK18UbXM RKXQ== Received: by 10.50.185.166 with SMTP id fd6mr12476376igc.62.1355302878164; Wed, 12 Dec 2012 01:01:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp186312igt; Wed, 12 Dec 2012 01:01:17 -0800 (PST) Received: by 10.66.79.72 with SMTP id h8mr779561pax.49.1355302877522; Wed, 12 Dec 2012 01:01:17 -0800 (PST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id w3si28399240pbz.18.2012.12.12.01.01.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 01:01:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f54.google.com with SMTP id bi5so406608pad.27 for ; Wed, 12 Dec 2012 01:01:17 -0800 (PST) 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 Cc: inki.dae@samsung.com, jy0922.shim@samsung.com, airlied@linux.ie, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQkHeCXr6QeeOPBk6G6zk4Gf2VPNTnbTizWvigmKx0TtQvI3BPUkiY/efZer64+UeSrYymTR 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