From nobody Sun Feb 8 02:55:51 2026 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87FD37DA7F for ; Thu, 15 Aug 2024 11:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723721112; cv=none; b=PZJMOXfvmhmmxGjUwRvw6KcRH2tcskl6hC3vcxIH0ZPZNGq8wa5dbq8IBNKdyrNrFq1siXe4ZVdh/WokEPPf4IbtpKTnQHqBb6eojQe58oIRkGIloBNlCHJ17L8/opE1aGydJ394VJorCQY05rfPDWHqzvjEtWHaD227/+KcdEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723721112; c=relaxed/simple; bh=lFo5gIFDvq0nCBY9vqftpLu+gTHD6YABYYNyYZUhWPg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=unVVdHKvG9sPEhyDekvFmpR8MmI8ttRwMlHOwTWDsQv9TOeFN6mfaTOJr0zxOz0CzDlK6dNOyM3b766Y0ipu9JB5XMqJ6cxSD4s6bdX8Alw5UCAJORa/P9bTOLSPyJ60f3CnQE+btfqSsufHgBT5liFNnt5CP89H2+Hu75uj0lE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UUIfyvYr; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UUIfyvYr" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso1267179a12.1 for ; Thu, 15 Aug 2024 04:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723721108; x=1724325908; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=sJgccsMLKlvTr7kW7rYfi0K+07lJJOFz1A3IB6P2Qqs=; b=UUIfyvYrsE6q+q7OtagMyPLfJcAWaELhx+at2X0k+00LmoCsU4raacO+uj9L6nwtMB ENi7JCTaQ5lZahVNxn1bsg1xQeA1JC9czjzys3ZG479YcYQQKiECxYCdhEZLOcILHCTl zLq/9aYKJPFCEvRkabPo5K+lWJkh3Ei6uKYnEggBSQWiN02xAFANr8BnyBJj3rrb3/rR XBDMKt13ArvR+WrCAyR61kcqUI1YEL/uBp2/AALVTWNjRKbi9shsqHIq/t6P/FzfIinn irWfJhlsDV0bG8g1OEnEmnpoefyqjFypyV+WFZh8QkkML4j8o8AYOswEcRhws6t3wdEJ tXpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723721108; x=1724325908; 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=sJgccsMLKlvTr7kW7rYfi0K+07lJJOFz1A3IB6P2Qqs=; b=N13Y2CzAAhBFSK+BIlGMsFCj7JjH2Qy8LTQcf16JE9xEDl+0sB8W+ugZFK31TDeeEe 0lo7gFI4RvBCfD38YB1h28mlYoJYa0yfa5hUQ6J0Zh50uUYabAeZUTASYZwsyxwM9HOV c83O+S/rGI0O0zlr/ZAZMIWow+e96XuKPAkOHm4jNURkfiETienOKVqj1lIzKwCewqMS CcoUb3Ravk5RAgicd4Aot7h7rAvRMY7zKgbIgdJx3S2DqEut9ak6dK87DCb1IRYogCc5 r97/MjBhZzBmY+Te1nlcm9I3abWu3HmGI4RoPcubzFHcjvaETwBqy2lrC49zrIVbmkME y4AQ== X-Forwarded-Encrypted: i=1; AJvYcCU9bUtCmV+KJBBHHCu7yVnGGhSVVlEcdc+aJAjhq+s8t+DX2UheDI6dsJMvKHYkLD5ISKZdlYD13RqjbZqid7pL2hrhGOZeFhSxivs6 X-Gm-Message-State: AOJu0YwjMRG9V0tXyn0tG24+aMrlUiF3dj3bhFO9Ili3U4BoboTlo3zq GPf4X0GwPIm8onfjxQdV/scp8+f3n3TpBZkH3OYI2jx62lDrUJ0YSTHQOXP2bWg= X-Google-Smtp-Source: AGHT+IHwCYaVWrDMM/XxSAgRaGSfa25IQdFx+8Hr+PoYjdMN7joZtfNCMY3zxeI7foru5gpy24rJbQ== X-Received: by 2002:a05:6402:3227:b0:5be:bd48:e4ca with SMTP id 4fb4d7f45d1cf-5bebd48e74bmr1231063a12.26.1723721107693; Thu, 15 Aug 2024 04:25:07 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bebbde48fdsm769217a12.28.2024.08.15.04.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 04:25:07 -0700 (PDT) Date: Thu, 15 Aug 2024 14:25:00 +0300 From: Dan Carpenter To: Shameer Kolothum Cc: Will Deacon , Robin Murphy , Joerg Roedel , Jason Gunthorpe , Nicolin Chen , Michael Shavit , Mostafa Saleh , Lu Baolu , Kevin Tian , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] iommu/arm-smmu-v3: Fix a NULL vs IS_ERR() check Message-ID: <9208cd0d-8105-40df-93e9-bdcdf0d55eec@stanley.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The arm_smmu_domain_alloc() function returns error pointers on error. It doesn't return NULL. Update the error checking to match. Fixes: 52acd7d8a413 ("iommu/arm-smmu-v3: Add support for domain_alloc_user = fn") Signed-off-by: Dan Carpenter Reviewed-by: Jason Gunthorpe Reviewed-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/ar= m/arm-smmu-v3/arm-smmu-v3.c index 9bc50bded5af..cf21d7d2e737 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3062,8 +3062,8 @@ arm_smmu_domain_alloc_user(struct device *dev, u32 fl= ags, return ERR_PTR(-EOPNOTSUPP); =20 smmu_domain =3D arm_smmu_domain_alloc(); - if (!smmu_domain) - return ERR_PTR(-ENOMEM); + if (IS_ERR(smmu_domain)) + return ERR_CAST(smmu_domain); =20 smmu_domain->domain.type =3D IOMMU_DOMAIN_UNMANAGED; smmu_domain->domain.ops =3D arm_smmu_ops.default_domain_ops; --=20 2.43.0