From patchwork Mon Jun 17 18:15:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11000023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3E67924 for ; Mon, 17 Jun 2019 18:16:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B988928984 for ; Mon, 17 Jun 2019 18:16:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE1C32898B; Mon, 17 Jun 2019 18:16:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A7D128984 for ; Mon, 17 Jun 2019 18:16:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1658C89271; Mon, 17 Jun 2019 18:16:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA8DE89271 for ; Mon, 17 Jun 2019 18:16:06 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id m29so11937164qtu.1 for ; Mon, 17 Jun 2019 11:16:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=37lcON4Q5cuuFVjtzVGGM/zMMeikjUdgaDG0gMlFfa0=; b=EUuXeOFBfWvNKijiImXpfAtAl4OO9Pw+vrvmke1aWQcIliuRfoerw+lyQuPoeMCm7a CmqWGEgSBcENa9US9sccRMzfH1GK2ynBoBS7sddHGZoZzyxrWEfbZz+nB+3p1iRM55Uv UnYcNzYUnRJzrynMuetFr1i5D6PtaB0FVM06xhpoy80a8sqftTMcxhDuBMc9Oe7smXzQ G1OzF0FI3NY75ARXjR5Gu4NIVhH67KvIOVsLJlxX/C2inHDRB/pJYwukbbFaolpavSx5 IL2sqIaM3ETu5519wVSSQGjts40XIJ5JAnUGNjFr2V2kJRW5l0r11qMlS2x3cugopLUu IWZw== X-Gm-Message-State: APjAAAWGjbezz3X7nR+PsdiNrcFBSX9+Jd57/NmcDs5GWQzatOPoizmp SGwmh8xtvvjsuw5hbH8dba7C+Q== X-Google-Smtp-Source: APXvYqxdM7PLs9QGhcr/Fx0QfODHq7qGPTdDffuZ6hzGaz6//LBmr2nkyDzhQxVJ9iRxyIuUsMMb1w== X-Received: by 2002:a0c:88c3:: with SMTP id 3mr22062442qvo.21.1560795365692; Mon, 17 Jun 2019 11:16:05 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([100.100.175.19]) by smtp.gmail.com with ESMTPSA id 15sm6976783qtf.2.2019.06.17.11.16.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 17 Jun 2019 11:16:05 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Date: Mon, 17 Jun 2019 14:15:42 -0400 Message-Id: <20190617181548.124134-1-sean@poorly.run> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=37lcON4Q5cuuFVjtzVGGM/zMMeikjUdgaDG0gMlFfa0=; b=G2wI1CqeTDlCGQ69ZKTKlW5ToPx1/aZ+J1j3AvhoR4iRaQejp0jafmg9E9Zo9fIcoi VWTDUsK/42dVlYodFSCqLNswkvHdc4HlrPx4U0GDcZy2LKVd5Pb5Mvv5nYHJVdY1PqC7 C9YW6sSZcJ3cl/SsKqdZZp6hly82ti/EtswFNt36594jIan27PZeZACF+nyaugCExpz1 ecWzp9n/70aeRY3AE179OZKfqMrxloVsr7pJX8asSqHwDLQfFmAjZhNh6/ueF+d6Vu1S BheM9zO9h3lV+8uF+dXDi9FAslkbjPc7UM822coUjymmIuZJrOxIgyDGO6evxaf6rUuN lKbQ== Subject: [Intel-gfx] [PATCH] drm/rcar-du: Fix error check when retrieving crtc state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Carpenter , Maxime Ripard , David Airlie , Karol Herbst , linux-renesas-soc@vger.kernel.org, Kieran Bingham , Sean Paul , Ben Skeggs , Ilia Mirkin , intel-gfx@lists.freedesktop.org, Laurent Pinchart Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul drm_atomic_get_crtc_state() returns an error pointer when it fails, so the null check is doing nothing here. Credit to 0-day/Dan Carpenter for reporting this. Fixes: 6f3b62781bbd ("drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state") Cc: Daniel Vetter Cc: Ville Syrjälä Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Ben Skeggs Cc: Laurent Pinchart Cc: Kieran Bingham Cc: Eric Anholt Cc: Laurent Pinchart [for rcar lvds] Cc: Sean Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: Lyude Paul Cc: Karol Herbst Cc: Ilia Mirkin Cc: dri-devel@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Reported-by: kbuild test robot Reported-by: Dan Carpenter Signed-off-by: Sean Paul Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_lvds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c index f2a5d4d997073..1c62578590f46 100644 --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c @@ -115,8 +115,8 @@ static int rcar_lvds_connector_atomic_check(struct drm_connector *connector, /* We're not allowed to modify the resolution. */ crtc_state = drm_atomic_get_crtc_state(state, conn_state->crtc); - if (!crtc_state) - return -EINVAL; + if (IS_ERR(crtc_state)) + return PTR_ERR(crtc_state); if (crtc_state->mode.hdisplay != panel_mode->hdisplay || crtc_state->mode.vdisplay != panel_mode->vdisplay)