projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5471d52
)
net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register
author
Miaoqian Lin
<linmq006@gmail.com>
Fri, 24 Dec 2021 02:14:59 +0000
(
02:14
+0000)
committer
Jakub Kicinski
<kuba@kernel.org>
Fri, 24 Dec 2021 22:52:10 +0000
(14:52 -0800)
The fixed_phy_get_gpiod function() returns NULL, it doesn't return error
pointers, using NULL checking to fix this.i
Fixes:
5468e82f7034
("net: phy: fixed-phy: Drop GPIO from fixed_phy_add()")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link:
https://lore.kernel.org/r/20211224021500.10362-1-linmq006@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/fixed_phy.c
patch
|
blob
|
history
diff --git
a/drivers/net/phy/fixed_phy.c
b/drivers/net/phy/fixed_phy.c
index
c65fb5f
..
a0c256b
100644
(file)
--- a/
drivers/net/phy/fixed_phy.c
+++ b/
drivers/net/phy/fixed_phy.c
@@
-239,8
+239,8
@@
static struct phy_device *__fixed_phy_register(unsigned int irq,
/* Check if we have a GPIO associated with this fixed phy */
if (!gpiod) {
gpiod = fixed_phy_get_gpiod(np);
- if (
IS_ERR(gpiod)
)
- return ERR_
CAST(gpiod
);
+ if (
!gpiod
)
+ return ERR_
PTR(-EINVAL
);
}
/* Get the next available PHY address, up to PHY_MAX_ADDR */