From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 331881774B; Thu, 18 Jan 2024 10:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705575327; cv=none; b=JsDj4ebbkaNH6rw2rcdPb7UmkWIgwRkGri8PAYNv0uAlQjQ9l7HBjhczg4qIx+vWntAr317GjYP6l139niqZ5U+IejO1ieSEyZhh3SdiOf8IdYcg59DehPNvpAb7OYIq6xIjqHSleeXHaqk+SJXSAX+LGWsQySKEK7xKK8zzAM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705575327; c=relaxed/simple; bh=nF7HBEnynD4pBYdMpp/PR3dY5qc1C2zrRREuMsF4YAg=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:User-Agent:X-stable: X-Patchwork-Hint:MIME-Version:Content-Transfer-Encoding; b=tcWucW2YDZTUzJmjbWeTGyg8OBNstKdpHxheyTZPUzoEOqnjorsFLf6prnoxcD4GymYMT5M7au0gT99+5zV0Wpovs1A71H4D+P8UOyrEpg62QcaMaTtIxxwpzrMi2bE1yV7anlnRRWZ6UomghnQpN1Je5bITOXVUQ3JfnJimCS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yumSxKXf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yumSxKXf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C1F1C433C7; Thu, 18 Jan 2024 10:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705575327; bh=nF7HBEnynD4pBYdMpp/PR3dY5qc1C2zrRREuMsF4YAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yumSxKXfrL36Yv4ADiNc5Pl6q6LZQ+ij4Hj/kodY+FgeUt/a2U2mf74upHPkonjVu 97faSJBJffuybktmMJGb1CJMh/+7Hh05KX//ET9TLsf8pECiM8FJgSalrWk97vPNSZ afjLH/dRnDsJ62WldS5pAnSxN6LY3k74i18WE950= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Inki Dae , Sasha Levin Subject: [PATCH 6.6 063/150] drm/exynos: fix a wrong error checking Date: Thu, 18 Jan 2024 11:48:05 +0100 Message-ID: <20240118104322.901552362@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240118104320.029537060@linuxfoundation.org> References: <20240118104320.029537060@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Inki Dae [ Upstream commit 8d1b7809684c688005706125b804e1f9792d2b1b ] Fix a wrong error checking in exynos_drm_dma.c module. In the exynos_drm_register_dma function, both arm_iommu_create_mapping() and iommu_get_domain_for_dev() functions are expected to return NULL as an error. However, the error checking is performed using the statement if(IS_ERR(mapping)), which doesn't provide a suitable error value. So check if 'mapping' is NULL, and if it is, return -ENODEV. This issue[1] was reported by Dan. Changelog v1: - fix build warning. [1] https://lore.kernel.org/all/33e52277-1349-472b-a55b-ab5c3462bfcf@moroto.mountain/ Reported-by : Dan Carpenter Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_dma.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c index a971590b8132..e2c7373f20c6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c @@ -107,18 +107,16 @@ int exynos_drm_register_dma(struct drm_device *drm, struct device *dev, return 0; if (!priv->mapping) { - void *mapping; + void *mapping = NULL; if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) mapping = arm_iommu_create_mapping(&platform_bus_type, EXYNOS_DEV_ADDR_START, EXYNOS_DEV_ADDR_SIZE); else if (IS_ENABLED(CONFIG_IOMMU_DMA)) mapping = iommu_get_domain_for_dev(priv->dma_dev); - else - mapping = ERR_PTR(-ENODEV); - if (IS_ERR(mapping)) - return PTR_ERR(mapping); + if (!mapping) + return -ENODEV; priv->mapping = mapping; } -- 2.43.0