From patchwork Mon Nov 19 09:20:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12914 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 90E0623FC1 for ; Mon, 19 Nov 2012 09:26:42 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 36C6EA18E6C for ; Mon, 19 Nov 2012 09:26:42 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6140178iej.11 for ; Mon, 19 Nov 2012 01:26:41 -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:x-gm-message-state; bh=d3lx1jU8Q4ZvYqGf440FdxdLo2VEmaAR5zKLTTJeZh0=; b=him4Ih9r2HM5vHb5DbzWjDiaqAujZ1egVaNrvCw9uetOPZSczCu0BcHzJmA1WiQ2gr toqmsmZNrMkJDlnpGpnFLoWFH8rf+P3lTvq/75Zu3I78F6kjAjet44evNfufvBpQKWnD LIvwPkLZ03bT31Fw3OoiiMYOCMfkOoJhOySlLPiPs5b/nc6G6kpMwKFemfmTql9wvOF2 VmE0hjza4URaOu8QLdeV81lcPsFIe2KIS7O45NJv0b0PARPrdhtCuwnfjIRTpwJx62NW eapvGsJGAPkPNc0ICTvMpmt3RrgD43lOspQ3M3pKJ+iyEytsj2Rc6MVY5Ldq9UqezDuc DFtw== Received: by 10.50.213.69 with SMTP id nq5mr5929123igc.70.1353317201664; Mon, 19 Nov 2012 01:26:41 -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 n20csp133604igt; Mon, 19 Nov 2012 01:26:41 -0800 (PST) Received: by 10.68.240.36 with SMTP id vx4mr31368495pbc.90.1353317200627; Mon, 19 Nov 2012 01:26:40 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id t9si12705492paz.113.2012.11.19.01.26.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:26:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.45 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-f45.google.com with SMTP id bg2so876224pad.18 for ; Mon, 19 Nov 2012 01:26:40 -0800 (PST) Received: by 10.68.191.200 with SMTP id ha8mr37160214pbc.51.1353317200003; Mon, 19 Nov 2012 01:26:40 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ku7sm5939870pbc.0.2012.11.19.01.26.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 01:26:39 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Cc: inki.dae@samsung.com, jy0922.shim@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] drm/exynos: Fix potential NULL pointer dereference in exynos_drm_encoder.c Date: Mon, 19 Nov 2012 14:50:30 +0530 Message-Id: <1353316830-23755-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlz5NguQhV1SdcWeKIs6X2ca9GYEu5PmCKVLXYDDd21u4t+w3FH8F3k76x/VGy56UkD4REO Check overlay_ops is not NULL as checked in the previous 'if' condition. Fixes the following smatch error: drivers/gpu/drm/exynos/exynos_drm_encoder.c:509 exynos_drm_encoder_plane_disable() error: we previously assumed 'overlay_ops' could be null (see line 499) Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index e51503f..a44238e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -506,6 +506,6 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) * because the setting for disabling the overlay will be updated * at vsync. */ - if (overlay_ops->wait_for_vblank) + if (overlay_ops && overlay_ops->wait_for_vblank) overlay_ops->wait_for_vblank(manager->dev); }