mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Daniel Glöckner" <dg@emlix.com>
To: barebox@lists.infradead.org
Cc: "Daniel Glöckner" <dg@emlix.com>
Subject: [PATCH v2 02/10] net: fixed-link phys are never acquired
Date: Thu, 14 May 2020 20:21:50 +0200	[thread overview]
Message-ID: <a27e4e52c15a3b7c7dab0619523929ce12d772b9.1589477005.git.dg@emlix.com> (raw)
In-Reply-To: <cover.1589477005.git.dg@emlix.com>
In-Reply-To: <cover.1589477005.git.dg@emlix.com>

Fixed-link phys have their bus field set to NULL. This causes a crash when
phy_acquired tries to check the slice of the bus.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
---
 include/linux/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index e93f6a01f..3f0f31b35 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -370,7 +370,7 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
 
 static inline bool phy_acquired(struct phy_device *phydev)
 {
-	return phydev && slice_acquired(&phydev->bus->slice);
+	return phydev && phydev->bus && slice_acquired(&phydev->bus->slice);
 }
 
 #ifdef CONFIG_PHYLIB
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-05-14 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 18:21 [PATCH v2 00/10] Support for Fastboot over UDP Daniel Glöckner
2020-05-14 18:21 ` [PATCH v2 01/10] Remove CONFIG_SLICE Daniel Glöckner
2020-05-14 18:21 ` Daniel Glöckner [this message]
2020-05-14 18:21 ` [PATCH v2 03/10] poller: adapt remaining users to API change Daniel Glöckner
2020-05-14 18:21 ` [PATCH v2 04/10] Introduce idle slice Daniel Glöckner
2020-05-20  6:03   ` Sascha Hauer
2020-05-14 18:21 ` [PATCH v2 05/10] ratp: use poller to run ratp commands Daniel Glöckner
2020-05-14 18:21 ` [PATCH v2 06/10] fastboot: split generic code from USB gadget Daniel Glöckner
2020-05-14 18:21 ` [PATCH v2 07/10] defconfigs: update renamed fastboot options Daniel Glöckner
2020-05-14 18:21 ` [PATCH v2 08/10] fastboot: rename usbgadget.fastboot_* variables to fastboot.* Daniel Glöckner
2020-05-20  4:55   ` Sascha Hauer
2020-05-14 18:21 ` [PATCH v2 09/10] fastboot net: implement fastboot over UDP Daniel Glöckner
2020-05-20  5:52   ` Sascha Hauer
2020-05-20  6:57     ` Daniel Glöckner
2020-05-20  8:14       ` Sascha Hauer
2020-05-20  8:17   ` Sascha Hauer
2020-05-14 18:21 ` [PATCH v2 10/10] fastboot: don't close fd 0 when downloading to ram Daniel Glöckner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a27e4e52c15a3b7c7dab0619523929ce12d772b9.1589477005.git.dg@emlix.com \
    --to=dg@emlix.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox