From patchwork Wed May 18 20:59:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 9124691 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A13DBF440 for ; Thu, 19 May 2016 08:00:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B92282024D for ; Thu, 19 May 2016 08:00:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1AA742022D for ; Thu, 19 May 2016 08:00:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B13006E93C; Thu, 19 May 2016 08:00:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99A276E8B4 for ; Wed, 18 May 2016 21:00:27 +0000 (UTC) Received: from LT001.lan ([62.143.92.134]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M1iGk-1bs5Ec45O6-00toNa; Wed, 18 May 2016 23:00:05 +0200 From: Heinrich Schuchardt To: David Airlie , Matthias Brugger Subject: [PATCH 1/1] drm/mediatek: do not dereference NULL Date: Wed, 18 May 2016 22:59:50 +0200 Message-Id: <1463605190-5323-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 X-Provags-ID: V03:K0:bHfleQoElv3zgxLmLjVXw8y2f/lWRZXgQYU8+PQVqVhPLwwk9rE ncwKzq8DCmao8ybV2NPjoW0U+O45NV44KShHooxmOoA4eW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schuchardt , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After having verified that dpi is NULL we should not dereference it. Signed-off-by: Heinrich Schuchardt Reviewed-by: Eric Engestrom --- drivers/gpu/drm/mediatek/mtk_dpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index d05ca79..3dbd00d 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -433,7 +433,7 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, unsigned int factor; if (!dpi) { - dev_err(dpi->dev, "invalid argument\n"); + dev_err(NULL, "invalid argument\n"); return -EINVAL; }