From: Philipp Zabel <p.zabel@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] efi: skip devices without driver in efi_pause/continue_devices()
Date: Tue, 18 Jan 2022 14:43:17 +0100 [thread overview]
Message-ID: <20220118134317.1686090-1-p.zabel@pengutronix.de> (raw)
Skip devices on the EFI bus that do not have a driver assigned.
Fixes: f68a547deebd ("efi: add efi_device hook to be called before an image is started")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/efi/efi-device.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c
index 39724ec2f431..f91d09e8eaa5 100644
--- a/drivers/efi/efi-device.c
+++ b/drivers/efi/efi-device.c
@@ -473,7 +473,12 @@ void efi_pause_devices(void)
bus_for_each_device(&efi_bus, dev) {
struct driver_d *drv = dev->driver;
struct efi_device *efidev = to_efi_device(dev);
- struct efi_driver *efidrv = to_efi_driver(drv);
+ struct efi_driver *efidrv;
+
+ if (!drv)
+ continue;
+
+ efidrv = to_efi_driver(drv);
if (efidrv->dev_pause)
efidrv->dev_pause(efidev);
@@ -487,7 +492,12 @@ void efi_continue_devices(void)
bus_for_each_device(&efi_bus, dev) {
struct driver_d *drv = dev->driver;
struct efi_device *efidev = to_efi_device(dev);
- struct efi_driver *efidrv = to_efi_driver(drv);
+ struct efi_driver *efidrv;
+
+ if (!drv)
+ continue;
+
+ efidrv = to_efi_driver(drv);
if (efidrv->dev_continue)
efidrv->dev_continue(efidev);
--
2.30.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2022-01-18 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-18 13:43 Philipp Zabel [this message]
2022-01-18 15:14 ` Michael Olbrich
2022-01-20 8:33 ` Sascha Hauer
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=20220118134317.1686090-1-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--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