From patchwork Wed Mar 22 09:06:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13183690 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 493D2C6FD1C for ; Wed, 22 Mar 2023 09:07:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94CA210E8C1; Wed, 22 Mar 2023 09:07:02 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED56310E8C1 for ; Wed, 22 Mar 2023 09:07:00 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id l27so7884538wrb.2 for ; Wed, 22 Mar 2023 02:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679476019; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=PHk+VaDQI0rTpTXkNcesDIxJIN8W2c9dqQAphpW43vY=; b=SMP1g2q2pIyCWahv36Bw48YL7tBMXOtnWMZS2ugqHshM9QS+MqZKFVQvOAXWMllQOj NBxcOm+sSFVF5vBQRLg12au7Ps9C/qVFOSl30tdulTDNRXvf6qS2XvtAwu4aSbnRYeJu /5HyGKEqRJhmX/553gd59CgUIO0f+vFaCyViNXE4FnwpMoCt1CL9Hvixu2+3evoWTHee j7D13vQcbfeHAqjDNucuzx1JZREVozWvpIXadoWp2cPvcYPMy5kpbpk/pwE412tX7Azc 3/w1CzKV0WB6egOToxTMKP3HT2BzamTuwxe9vAL4B8LwGJ6JqBIyAfhNFwsWf06RaSrV Sfuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679476019; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PHk+VaDQI0rTpTXkNcesDIxJIN8W2c9dqQAphpW43vY=; b=keSK9ScXXMtXusfwbwWH+OZ9+34R4fmEWktyOwPCgqRSNQd2ehP6vlUPgwp26JfSKr 1zXONwLDVJTtsvb3XbUDWFmFNTPbYax43/gUN9H+onE/Su5LotFRMRfA6p24vAziZ2cj HvgcdQa1ymwsorIcIPO9kw+7SuEZdZ50xVdjjFrnos6U2jDdqsWdhI1+fu/1nNaL5yB3 tS9lqPIhY1XcGMxZk87UUgzrIP/CuCM+G+myBlbkUti1B3c7joZ0VKpfFCF/S7c9FIV8 eqsZPPPqAHwMvnOsh2DlaNYCOXWTCs3nPgynXUpPMhctD1nx/iwM0tP5g06t1WGBu0qx GuhA== X-Gm-Message-State: AO0yUKV7GR22oXQPvqOAtVWrv5GQkq6de3Hg3qfc5ItVtAtK58458Onc HJs0olvkLQvmoU7ei0q2JqM= X-Google-Smtp-Source: AK7set9RFIuVDmgZ+l/wooxIdhLoXYmUMIW7OZDZGXrEvCM7uhpoZiSQdSPuLYfC5ZqxoCbug1HdeQ== X-Received: by 2002:a5d:63c7:0:b0:2d1:6b10:f33c with SMTP id c7-20020a5d63c7000000b002d16b10f33cmr4513060wrw.14.1679476019423; Wed, 22 Mar 2023 02:06:59 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id o6-20020adfeac6000000b002c71a32394dsm13386534wrn.64.2023.03.22.02.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 02:06:58 -0700 (PDT) Date: Wed, 22 Mar 2023 12:06:55 +0300 From: Dan Carpenter To: Marian Cichy Subject: [PATCH] drm/imx/lcdc: fix a NULL vs IS_ERR() bug in probe Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marian Cichy , Shawn Guo , Sascha Hauer , kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , Uwe =?iso-8859-1?q?Kleine-?= =?iso-8859-1?q?K=F6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The devm_drm_dev_alloc() function returns error pointers. It never returns NULL. Fix the check. Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König --- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c index 24bc7b310367..fc1a4f6657c5 100644 --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c @@ -399,8 +399,8 @@ static int imx_lcdc_probe(struct platform_device *pdev) lcdc = devm_drm_dev_alloc(dev, &imx_lcdc_drm_driver, struct imx_lcdc, drm); - if (!lcdc) - return -ENOMEM; + if (IS_ERR(lcdc)) + return PTR_ERR(lcdc); drm = &lcdc->drm;