include: phy: fix NULL pointer check in phy_write()
PATCH 1/1 include: phy: fix NULL pointer check in phy_write()
phy_write() uses bus->write() instead of bus->read(). This means NULL pointer pre-check needs to happen on bus->write instead of bus->read.
--- include/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/phy.h +1 -1
@@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, {struct mii_dev *bus = phydev->bus; -if (!bus || !bus->read) { +if (!bus || !bus->write) {debug ("%s: No bus configured\n" , __func__);return -1 ; }
Signature · 1 line
2.25.2
PATCH 1/1 include: phy: fix NULL pointer check in phy_write()
Quoted 14 lines · Thirupathaiah Annapureddy
phy_write()usesbus->write()instead ofbus->read(). This means NULL pointer pre-check needs to happen onbus->writeinstead ofbus->read.Signed-off-by Thirupathaiah Annapureddy <[email protected]>--- include/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy.h +0
-0
include/phy.h static inline int phy_write(struct phy_device *phydev, int devad, int regnum, · line 211
Quoted 8 lines
include/phy.h +1
-1@@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, {struct mii_dev *bus = phydev->bus; -if (!bus || !bus->read) { +if (!bus || !bus->write) {debug ("%s: No bus configured\n" , __func__);return -1 ; }
Thanks,
Michal
PATCH 1/1 include: phy: fix NULL pointer check in phy_write()
In reply to Thirupathaiah AnnapureddyHi Tom,
?t 18. 8. 2020 v 2:31 odes?latel Thirupathaiah Annapureddy <[email protected]> napsal:
Quoted 23 lines
phy_write()usesbus->write()instead ofbus->read(). This means NULL pointer pre-check needs to happen onbus->writeinstead ofbus->read.Signed-off-by Thirupathaiah Annapureddy <[email protected]>--- include/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy.h +1
-2@@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, {struct mii_dev *bus = phydev->bus; -if (!bus || !bus->read) { +if (!bus || !bus->write) {debug ("%s: No bus configured\n" , __func__);return -1 ; } --
Quoted 2 lines
2.25.2
Please also take this patch to your tree.
Thanks,
Michal
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
PATCH 1/1 include: phy: fix NULL pointer check in phy_write()
Quoted 21 lines · Michal Simek
Hi Tom,
?t 18. 8. 2020 v 2:31 odes?latel Thirupathaiah Annapureddy <[email protected]> napsal:
Quoted 17 lines
phy_write()usesbus->write()instead ofbus->read(). This means NULL pointer pre-check needs to happen onbus->writeinstead ofbus->read.Signed-off-by Thirupathaiah Annapureddy <[email protected]>--- include/phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy.h +0
-0@@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum, {struct mii_dev *bus = phydev->bus;
Quoted 10 lines
Quoted 8 lines
include/phy.h +1
-2-if (!bus || !bus->read) { +if (!bus || !bus->write) {debug ("%s: No bus configured\n" , __func__);return -1 ; } --2.25.2
Please also take this patch to your tree.
OK, will do.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200915/bf61aa7a/attachment.sig>
PATCH 1/1 include: phy: fix NULL pointer check in phy_write()
In reply to Thirupathaiah AnnapureddyQuoted 5 lines · Thirupathaiah Annapureddy
phy_write()usesbus->write()instead ofbus->read(). This means NULL pointer pre-check needs to happen onbus->writeinstead ofbus->read.Signed-off-by Thirupathaiah Annapureddy <[email protected]>Reviewed-by Michal Simek <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200917/3076d1f9/attachment.sig>