From mboxrd@z Thu Jan 1 00:00:00 1970 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 7E2AECD1288 for ; Wed, 3 Apr 2024 07:15:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B047112126; Wed, 3 Apr 2024 07:15:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="ViAfPzC1"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6AFA3112126 for ; Wed, 3 Apr 2024 07:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712128540; bh=O2Nzrqa1UBTMb8L+eVoapV/8MuTe2W1MsZDuTz8sSHE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ViAfPzC17nr2LDYMZ6/FxnERiwG3pLNtEQ1PhWB3lBg4eqEx/rNxSY2FGP4+P5IKo xcwLa4vQiJoE5g6opA/TB04PVtK1hxoyxc17ROithVL6mJgFYM6c7ipDie2lqBS5NV N7taljBXd72ojJvAVzcGTF9S0hyN3SlwIzln4ZiES8NCrb9Ds73SYHIi8PY9wtDe4l YT4UcYDUpqwc8fiiH0twCSpSAEIk7cF/W1ILel1D7L6SuNaqBFfCZ3nynWrGzrUsED S20AqxcjXw1rbd8uM1tq/pNoRf7s2niM+KTIEAqYk2jSQMUJXS2BuXLYiGPM+jGSR2 k6lz9WKCHC58g== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6464F37813DC; Wed, 3 Apr 2024 07:15:39 +0000 (UTC) Date: Wed, 3 Apr 2024 09:15:38 +0200 From: Boris Brezillon To: Harshit Mogalapalli Cc: Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Grant Likely , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com Subject: Re: [PATCH] drm/panthor: Fix NULL vs IS_ERR() bug in panthor_probe() Message-ID: <20240403091538.1b958019@collabora.com> In-Reply-To: <20240402104041.1689951-1-harshit.m.mogalapalli@oracle.com> References: <20240402104041.1689951-1-harshit.m.mogalapalli@oracle.com> Organization: Collabora X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 2 Apr 2024 03:40:40 -0700 Harshit Mogalapalli wrote: > The devm_drm_dev_alloc() function returns error pointers. > Update the error handling to check for error pointers instead of NULL. > > Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block") > Signed-off-by: Harshit Mogalapalli Queued to drm-misc-next. Thanks, Boris > --- > This is spotted by smatch and the patch is only compile tested > --- > drivers/gpu/drm/panthor/panthor_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c > index 11b3ccd58f85..1b588b37db98 100644 > --- a/drivers/gpu/drm/panthor/panthor_drv.c > +++ b/drivers/gpu/drm/panthor/panthor_drv.c > @@ -1385,7 +1385,7 @@ static int panthor_probe(struct platform_device *pdev) > > ptdev = devm_drm_dev_alloc(&pdev->dev, &panthor_drm_driver, > struct panthor_device, base); > - if (!ptdev) > + if (IS_ERR(ptdev)) > return -ENOMEM; > > platform_set_drvdata(pdev, ptdev);