From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Fri, 05 Dec 2014 12:07:27 +0000 Subject: Re: [patch] drm/tegra: checking IS_ERR() instead of NULL Message-Id: <54819FFF.4000907@users.sourceforge.net> List-Id: References: <20141204110035.GC22643@mwanda> <20141204132349.GD7262@ulmo.nvidia.com> In-Reply-To: <20141204132349.GD7262-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thierry Reding , Dan Carpenter Cc: =?windows-1252?Q?Terje_Bergstr=F6m?= , David Airlie , Stephen Warren , Alexandre Courbot , dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c >> index e549afe..fa16048 100644 >> --- a/drivers/gpu/drm/tegra/drm.c >> +++ b/drivers/gpu/drm/tegra/drm.c >> @@ -36,8 +36,8 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags) >> >> if (iommu_present(&platform_bus_type)) { >> tegra->domain = iommu_domain_alloc(&platform_bus_type); >> - if (IS_ERR(tegra->domain)) { >> - err = PTR_ERR(tegra->domain); >> + if (!tegra->domain) { >> + err = -ENOMEM; >> goto free; >> } > > Oh, good catch. Applied, thanks. How do you think about to amend the commit title? Is the following wording more appropriate? drm/tegra: Checking for NULL pointer instead of IS_ERR() usage Regards, Markus