All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: korina: Fix return value check in korina_probe()
@ 2021-05-13 12:46 Wei Yongjun
  2021-05-13 23:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2021-05-13 12:46 UTC (permalink / raw)
  To: weiyongjun1, David S. Miller, Jakub Kicinski,
	Thomas Bogendoerfer, Andrew Lunn, Andrew Morton, Valentin Vidic,
	Mike Rapoport, Vincent Stehlé
  Cc: netdev, kernel-janitors, Hulk Robot

In case of error, the function devm_platform_ioremap_resource_byname()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: b4cd249a8cc0 ("net: korina: Use devres functions")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/korina.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index 6f987a7ffcb3..b30a45725374 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -1315,23 +1315,23 @@ static int korina_probe(struct platform_device *pdev)
 	lp->tx_irq = platform_get_irq_byname(pdev, "tx");
 
 	p = devm_platform_ioremap_resource_byname(pdev, "emac");
-	if (!p) {
+	if (IS_ERR(p)) {
 		printk(KERN_ERR DRV_NAME ": cannot remap registers\n");
-		return -ENOMEM;
+		return PTR_ERR(p);
 	}
 	lp->eth_regs = p;
 
 	p = devm_platform_ioremap_resource_byname(pdev, "dma_rx");
-	if (!p) {
+	if (IS_ERR(p)) {
 		printk(KERN_ERR DRV_NAME ": cannot remap Rx DMA registers\n");
-		return -ENOMEM;
+		return PTR_ERR(p);
 	}
 	lp->rx_dma_regs = p;
 
 	p = devm_platform_ioremap_resource_byname(pdev, "dma_tx");
-	if (!p) {
+	if (IS_ERR(p)) {
 		printk(KERN_ERR DRV_NAME ": cannot remap Tx DMA registers\n");
-		return -ENOMEM;
+		return PTR_ERR(p);
 	}
 	lp->tx_dma_regs = p;
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: korina: Fix return value check in korina_probe()
  2021-05-13 12:46 [PATCH net] net: korina: Fix return value check in korina_probe() Wei Yongjun
@ 2021-05-13 23:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-13 23:00 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: davem, kuba, tsbogend, andrew, akpm, vvidic, rppt,
	vincent.stehle, netdev, kernel-janitors, hulkci

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 13 May 2021 12:46:21 +0000 you wrote:
> In case of error, the function devm_platform_ioremap_resource_byname()
> returns ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
> 
> Fixes: b4cd249a8cc0 ("net: korina: Use devres functions")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net] net: korina: Fix return value check in korina_probe()
    https://git.kernel.org/netdev/net/c/c7d8302478ae

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-13 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 12:46 [PATCH net] net: korina: Fix return value check in korina_probe() Wei Yongjun
2021-05-13 23:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.