All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include: phy: fix NULL pointer check in phy_write()
@ 2020-08-18  0:31 Thirupathaiah Annapureddy
  2020-08-18  6:07 ` Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thirupathaiah Annapureddy @ 2020-08-18  0:31 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
---
 include/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/phy.h b/include/phy.h
index 1dbbf65111..cbdb10d6fc 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -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;
 	}
-- 
2.25.2

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

* [PATCH] include: phy: fix NULL pointer check in phy_write()
  2020-08-18  0:31 [PATCH] include: phy: fix NULL pointer check in phy_write() Thirupathaiah Annapureddy
@ 2020-08-18  6:07 ` Michal Simek
  2020-09-15 14:23 ` Michal Simek
  2020-09-17 13:54 ` Tom Rini
  2 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-08-18  6:07 UTC (permalink / raw)
  To: u-boot



On 18. 08. 20 2:31, Thirupathaiah Annapureddy wrote:
> 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.
> 
> Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
> ---
>  include/phy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/phy.h b/include/phy.h
> index 1dbbf65111..cbdb10d6fc 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -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;
>  	}
> 

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

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

* [PATCH] include: phy: fix NULL pointer check in phy_write()
  2020-08-18  0:31 [PATCH] include: phy: fix NULL pointer check in phy_write() Thirupathaiah Annapureddy
  2020-08-18  6:07 ` Michal Simek
@ 2020-09-15 14:23 ` Michal Simek
  2020-09-15 15:00   ` Tom Rini
  2020-09-17 13:54 ` Tom Rini
  2 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2020-09-15 14:23 UTC (permalink / raw)
  To: u-boot

Hi Tom,

?t 18. 8. 2020 v 2:31 odes?latel Thirupathaiah Annapureddy
<thiruan@linux.microsoft.com> napsal:
>
> 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.
>
> Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
> ---
>  include/phy.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/phy.h b/include/phy.h
> index 1dbbf65111..cbdb10d6fc 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -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;
>         }
> --
> 2.25.2
>

Please also take this patch to your tree.

Thanks,
Michal

-- 
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

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

* [PATCH] include: phy: fix NULL pointer check in phy_write()
  2020-09-15 14:23 ` Michal Simek
@ 2020-09-15 15:00   ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-09-15 15:00 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 15, 2020 at 04:23:02PM +0200, Michal Simek wrote:
> Hi Tom,
> 
> ?t 18. 8. 2020 v 2:31 odes?latel Thirupathaiah Annapureddy
> <thiruan@linux.microsoft.com> napsal:
> >
> > 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.
> >
> > Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
> > ---
> >  include/phy.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/phy.h b/include/phy.h
> > index 1dbbf65111..cbdb10d6fc 100644
> > --- a/include/phy.h
> > +++ b/include/phy.h
> > @@ -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;
> >         }
> > --
> > 2.25.2
> >
> 
> Please also take this patch to your tree.

OK, will do.

-- 
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>

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

* [PATCH] include: phy: fix NULL pointer check in phy_write()
  2020-08-18  0:31 [PATCH] include: phy: fix NULL pointer check in phy_write() Thirupathaiah Annapureddy
  2020-08-18  6:07 ` Michal Simek
  2020-09-15 14:23 ` Michal Simek
@ 2020-09-17 13:54 ` Tom Rini
  2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-09-17 13:54 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 17, 2020 at 05:31:08PM -0700, Thirupathaiah Annapureddy wrote:

> 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.
> 
> Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
> Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Applied to u-boot/master, thanks!

-- 
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>

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

end of thread, other threads:[~2020-09-17 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18  0:31 [PATCH] include: phy: fix NULL pointer check in phy_write() Thirupathaiah Annapureddy
2020-08-18  6:07 ` Michal Simek
2020-09-15 14:23 ` Michal Simek
2020-09-15 15:00   ` Tom Rini
2020-09-17 13:54 ` Tom Rini

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.