[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240324224720.1345309-638-sashal@kernel.org>
Date: Sun, 24 Mar 2024 18:46:03 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Dan Carpenter <dan.carpenter@...aro.org>,
Michal Simek <michal.simek@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 6.7 637/713] char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
From: Dan Carpenter <dan.carpenter@...aro.org>
[ Upstream commit 316459ba4051fd91237171fdca88920128a646f1 ]
The devm_platform_ioremap_resource() function returns error pointers.
It never returns NULL. Update the check accordingly.
Fixes: 672371832193 ("char: xilinx_hwicap: Modernize driver probe")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
Acked-by: Michal Simek <michal.simek@....com>
Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index 019cf6079cecd..6d2eadefd9dc9 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
dev_set_drvdata(dev, (void *)drvdata);
drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
- if (!drvdata->base_address) {
- retval = -ENODEV;
+ if (IS_ERR(drvdata->base_address)) {
+ retval = PTR_ERR(drvdata->base_address);
goto failed;
}
--
2.43.0
Powered by blists - more mailing lists