Skip to contentSkip to conversation

efi_loader: add missing EFI_EXIT in efi_disconnect_controller

PATCH Superseded Vincent Stehlé 4 participants 13 messages Jun 18 – Jul 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: add missing EFI_EXIT in efi_disconnect_controller

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
 				      &number_of_children,
 				      &child_handle_buffer);
 	if (r != EFI_SUCCESS)
-		return r;
+		return EFI_EXIT(r);
 	sole_child = (number_of_children == 1);
 
 	if (child_handle) {
Signature · 1 line
2.53.0
#1 lore raw

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

Quoted 25 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -2
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--
Quoted 2 lines

2.53.0

Regards,
Simon

#2 lore raw

Hi Vincent,

Quoted 30 lines · Simon Glass

Hi Vincent,

Quoted 2 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when

returning

Quoted 3 lines

after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

Quoted 2 lines

Link:

https://git.pengutronix.de/cgit/barebox/commit/?id=080db65e39a877b000baaf843c997a69821dfe69
[1]

Quoted 1 line
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole

child")

Review

Quoted 9 lines
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/lib/efi_loader/efi_boottime.c

Quoted 10 lines

lib/efi_loader/efi_boottime.c efi_status_t EFIAPI efi_disconnect_controller( · line 3898

Quoted 9 lines

index de57823bd44..b6966652d97 100644

lib/efi_loader/efi_boottime.c +1 -1
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);

Any reason we can just goto out;

Thanks
/Ilias

Quoted 10 lines
Quoted 6 lines
lib/efi_loader/efi_boottime.c +0 -1
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--

2.53.0

Regards,
Simon

#3 lore raw
Quoted 29 lines · Ilias Apalodimas

Hi Vincent,

Quoted 24 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

Quoted 11 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 10 lines

lib/efi_loader/efi_boottime.c efi_status_t EFIAPI efi_disconnect_controller( · line 3898

Quoted 10 lines
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);

Any reason we can just goto out;

+1...every other error path uses 'goto out' so the single EFI_EXIT() at the bottom handles things - child_handle_buffer is initialised to NULL so the free() at out is safe.

Quoted 9 lines

Thanks
/Ilias

Quoted 6 lines
Quoted 6 lines
lib/efi_loader/efi_boottime.c +0 -1
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--

2.53.0

Regards,
Simon

#4 lore raw
Quoted 45 lines · Simon Glass
Quoted 29 lines · Ilias Apalodimas

Hi Vincent,

Quoted 24 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

Quoted 11 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 10 lines

lib/efi_loader/efi_boottime.c efi_status_t EFIAPI efi_disconnect_controller( · line 3898

Quoted 10 lines
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);

Any reason we can just goto out;

Quoted 3 lines

+1...every other error path uses 'goto out' so the single EFI_EXIT() at the bottom handles things - child_handle_buffer is initialised to NULL so the free() at out is safe.

Hi,

I think you are right; I will send a v2.

Best regards,
Vincent.

Quoted 13 lines
Quoted 10 lines

Thanks
/Ilias

Quoted 6 lines
Quoted 6 lines
lib/efi_loader/efi_boottime.c +0 -1
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--

2.53.0

Regards,
Simon

#5 lore raw
In reply to Simon Glass

Hello,

Quoted 11 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

It's not as extensive as U-Boot's yet, but it's usable for the common boot me a distro GRUB use case. The code originated from U-Boot with some parts heavily rewritten to fit barebox, e.g. the EFI filesystem protocol is implemented on top of dirfds, so it reuses VFS path handling and other such things.

The imported files have Origin-URL comments pointing back at U-Boot including the revision they originated from, but we are still in need of better tooling to make use of these tags.

@Vincent, I suspect a number of fixes in [1] are also applicable to U-Boot, but I haven't checked.

[1]:
https://lore.kernel.org/barebox/[email protected]/

Cheers,
Ahmad

Quoted 32 lines
Quoted 26 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -2
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--
Quoted 2 lines

2.53.0

Regards,
Simon

Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
#6 lore raw

Hi Ahmad,

Quoted 13 lines · Ahmad Fatoum

Hello,

Quoted 9 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Quoted 8 lines
Quoted 2 lines

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

It's not as extensive as U-Boot's yet, but it's usable for the common boot me a distro GRUB use case. The code originated from U-Boot with some parts heavily rewritten to fit barebox, e.g. the EFI filesystem protocol is implemented on top of dirfds, so it reuses VFS path handling and other such things.

OK good. I did create a VFS in Concept but I have not tried to get it into mainline yet.

Quoted 4 lines

The imported files have Origin-URL comments pointing back at U-Boot including the revision they originated from, but we are still in need of better tooling to make use of these tags.

On another topic - where did we get to with the whole-FITsigning thing? Should we set up a call to talk it through?

Regards,
Simon

Quoted 51 lines

@Vincent, I suspect a number of fixes in [1] are also applicable to U-Boot, but I haven't checked.

[1]:
https://lore.kernel.org/barebox/[email protected]/

Cheers,
Ahmad

Quoted 24 lines
Quoted 24 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
Quoted 8 lines
Quoted 4 lines
lib/efi_loader/efi_boottime.c +0 -1
        if (child_handle) {
--

2.53.0

Regards,
Simon

--

Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
#7 lore raw

Hello Simon,

Quoted 19 lines · Simon Glass

Hi Ahmad,

Quoted 16 lines · Ahmad Fatoum

Hello,

Quoted 11 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

Quoted 8 lines
Quoted 5 lines

It's not as extensive as U-Boot's yet, but it's usable for the common boot me a distro GRUB use case. The code originated from U-Boot with some parts heavily rewritten to fit barebox, e.g. the EFI filesystem protocol is implemented on top of dirfds, so it reuses VFS path handling and other such things.

OK good. I did create a VFS in Concept but I have not tried to get it into mainline yet.

Cool. I really look forward to cp /dev/sd /dev/emmc just working :-)

Quoted 6 lines
Quoted 3 lines

The imported files have Origin-URL comments pointing back at U-Boot including the revision they originated from, but we are still in need of better tooling to make use of these tags.

On another topic - where did we get to with the whole-FITsigning thing? Should we set up a call to talk it through?

This is still something I am interested in landing. I had started a review of your counterproposal, but got distracted before finishing it. I submitted it now.

Cheers,
Ahmad

Quoted 56 lines

Regards,
Simon

Quoted 51 lines

@Vincent, I suspect a number of fixes in [1] are also applicable to U-Boot, but I haven't checked.

[1]:
https://lore.kernel.org/barebox/[email protected]/

Cheers,
Ahmad

Quoted 24 lines
Quoted 24 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
Quoted 8 lines
Quoted 4 lines
lib/efi_loader/efi_boottime.c +0 -1
        if (child_handle) {
--

2.53.0

Regards,
Simon

--

Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
#8 lore raw

Hi Ahmad,

Quoted 29 lines · Ahmad Fatoum

Hello Simon,

Quoted 25 lines · Simon Glass

Hi Ahmad,

Quoted 21 lines · Ahmad Fatoum

Hello,

Quoted 11 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now? I wish we could bring these projects back together :-)

It's not as extensive as U-Boot's yet, but it's usable for the common boot me a distro GRUB use case. The code originated from U-Boot with some parts heavily rewritten to fit barebox, e.g. the EFI filesystem protocol is implemented on top of dirfds, so it reuses VFS path handling and other such things.

Quoted 4 lines
Quoted 2 lines

OK good. I did create a VFS in Concept but I have not tried to get it into mainline yet.

Cool. I really look forward to cp /dev/sd /dev/emmc just working :-)

Well, you can copy:

=> mount hostfs . host
=> fs cp host/README host/Kconfig
81004 bytes copied
=>

but there is no device fs :-(

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The imported files have Origin-URL comments pointing back at U-Boot including the revision they originated from, but we are still in need of better tooling to make use of these tags.

Quoted 6 lines
Quoted 2 lines

On another topic - where did we get to with the whole-FITsigning thing? Should we set up a call to talk it through?

This is still something I am interested in landing. I had started a review of your counterproposal, but got distracted before finishing it. I submitted it now.

OK great, thanks, will take a look.

Quoted 44 lines

Cheers,
Ahmad

Quoted 40 lines

Regards,
Simon

Quoted 36 lines

@Vincent, I suspect a number of fixes in [1] are also applicable to U-Boot, but I haven't checked.

[1]:
https://lore.kernel.org/barebox/[email protected]/

Cheers,
Ahmad

Quoted 24 lines
Quoted 24 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
lib/efi_loader/efi_boottime.c +0 -1
        if (child_handle) {
--

2.53.0

Regards,
Simon

#9 lore raw
In reply to Simon Glass
Quoted 10 lines · Simon Glass

Hi Vincent,

Quoted 5 lines · Vincent Stehlé

Make sure to call EFI_EXIT() in efi_disconnect_controller(), when returning after having called EFI_ENTRY().

This is inspired by a barebox fix. [1]

Hmm, does Barebox support EFI_LOADER now?

Hi Simon,

It does now: https://www.mail-archive.com/[email protected]/msg56391.html

Best regards,
Vincent.

Quoted 33 lines

I wish we could bring these
projects back together :-)

Quoted 25 lines
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -2
index de57823bd44..b6966652d97 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               return EFI_EXIT(r);
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--
Quoted 2 lines

2.53.0

Regards,
Simon

Signature · 1 line
Vincent.
#10 lore raw

PATCH v2 1/1 efi_loader: fix missing EFI_EXIT in efi_disconnect_controller

In reply to Vincent Stehlé

We are missing a call to EFI_EXIT() when returning from efi_disconnect_controller(), which we need after having called EFI_ENTRY().

Fix this by jumping to the common error path, which does call EFI_EXIT().

Even though the common error path may try to free child_handle_buffer, this cannot harm in our case as it always NULL.

This is inspired by a barebox fix. [1]

Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>

---

Changes for v2:
- Drop the return and jump to the common error path with a goto instead

 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -1
index de57823bd44..bcb01c92cf4 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
 				      &number_of_children,
 				      &child_handle_buffer);
 	if (r != EFI_SUCCESS)
-		return r;
+		goto out;
 	sole_child = (number_of_children == 1);
 
 	if (child_handle) {
Signature · 1 line
2.53.0
Reviewed-by on v2 1/1
#11 lore raw

Re: [PATCH v2] efi_loader: fix missing EFI_EXIT in efi_disconnect_controller

Thanks Vincent,

Quoted 10 lines · Vincent Stehlé

We are missing a call to EFI_EXIT() when returning from efi_disconnect_controller(), which we need after having called EFI_ENTRY().

Fix this by jumping to the common error path, which does call EFI_EXIT().

Even though the common error path may try to free child_handle_buffer, this cannot harm in our case as it always NULL.

This is inspired by a barebox fix. [1]

There's more in that link and some of them are still valid. Do you plan to send more?

Quoted 11 lines

Link:
https://git.pengutronix.de/cgit/barebox/commit/?id=080db65e39a877b000baaf843c997a69821dfe69

[1]
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole

child")

Cc Heinrich Schuchardt <[email protected]>
Cc Ilias Apalodimas <[email protected]>
Cc Tom Rini <[email protected]>

---

Quoted 26 lines

Changes for v2:
- Drop the return and jump to the common error path with a goto instead

 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -2
index de57823bd44..bcb01c92cf4 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                      &number_of_children,
                                      &child_handle_buffer);
        if (r != EFI_SUCCESS)
-               return r;
+               goto out;
        sole_child = (number_of_children == 1);
 
        if (child_handle) {
--

2.53.0

#12 lore raw

Re: [PATCH v2] efi_loader: fix missing EFI_EXIT in efi_disconnect_controller

Quoted 8 lines · Ilias Apalodimas

Thanks Vincent,

Quoted 4 lines · Vincent Stehlé

We are missing a call to EFI_EXIT() when returning from efi_disconnect_controller(), which we need after having called EFI_ENTRY().

Fix this by jumping to the common error path, which does call EFI_EXIT().

Quoted 7 lines
Quoted 4 lines

Even though the common error path may try to free child_handle_buffer, this cannot harm in our case as it always NULL.

This is inspired by a barebox fix. [1]

There's more in that link and some of them are still valid. Do you plan to send more?

Hi Ilias,

I am trying to, but... I have looked at the barebox fixes and I think they necessitate a triaging and verification effort.

- Some fixes are not applicable to U-Boot (e.g. [1]).
- Some fixes look applicable to U-Boot but in fact are not (I tried to reproduce
[2] on U-Boot with a unit test for example, but I could not make the test fail).
- Some fixes look applicable but I would like to verify completeness (I am looking at [3] for example).
- And last but not least, some fixes are difficult for me to review.

This makes me think that we should try to create a "reproducer" in lib/efi_selftest/ systematically for each fix to the EFI Loader.

Best regards,
Vincent.

[1] https://git.pengutronix.de/cgit/barebox/commit/efi/loader?id=f34f05ff87cf3a0a9f7345227f9a080ddcf3ec48
[2] https://git.pengutronix.de/cgit/barebox/commit/efi/loader?id=cbe4bd04edec9c1d3c843fcc22e1a7ae5c9c4551
[3] https://git.pengutronix.de/cgit/barebox/commit/efi/loader?id=4e9944e5cd1170cb5c54f97f4e12ddeccba53e55

Quoted 46 lines
Quoted 10 lines

Link:
[2]https://git.pengutronix.de/cgit/barebox/commit/?id=080db65e39a877b000baaf843c997a69821dfe69

[1]
Fixes 314bed6c854e ("efi_loader: fix DisconnectController() for sole child")
Cc Heinrich Schuchardt <[4][email protected]>
Cc Ilias Apalodimas <[5][email protected]>
Cc Tom Rini <[6][email protected]>

---

Quoted 20 lines

Changes for v2:
- Drop the return and jump to the common error path with a goto instead

 lib/efi_loader/efi_boottime.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_boottime.c +1 -2
index de57823bd44..bcb01c92cf4 100644
@@ -3895,7 +3895,7 @@ efi_status_t EFIAPI efi_disconnect_controller(
                                       &number_of_children,
                                       &child_handle_buffer);
         if (r != EFI_SUCCESS)
-               return r;
+               goto out;
         sole_child = (number_of_children == 1);
 
         if (child_handle) {
--
Quoted 1 line

2.53.0

References

Visible links
1. mailto:[email protected]
2. https://git.pengutronix.de/cgit/barebox/commit/?id=080db65e39a877b000baaf843c997a69821dfe69
3. mailto:[email protected]
4. mailto:[email protected]
5. mailto:[email protected]
6. mailto:[email protected]
7. mailto:[email protected]

Signature · 1 line
Vincent.