Skip to contentSkip to conversation

fastboot: block: fix wrong device pointer check

PATCH In review David Lechner 2 participants 3 messages Nov 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fastboot: block: fix wrong device pointer check

Check the block device returned by blk_get_dev() instead of the pointer to where it is stored, which is never NULL, so that a missing device is reported to the host instead of being dereferenced later.

Fixes 4bf92b541af6 ("fastboot: blk: introduce fastboot block flashing support")
---
 drivers/fastboot/fb_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fastboot/fb_block.c +1 -1
index 68593244ab9..16b94b8a0b2 100644
@@ -147,7 +147,7 @@ int fastboot_block_get_part_info(const char *part_name,
 	}
 
 	*dev_desc = blk_get_dev(interface, device);
-	if (!dev_desc) {
+	if (!*dev_desc) {
 		fastboot_fail("no such device", response);
 		return -ENODEV;
 	}

---
base-commit: 6201222134cd704b5717211fc917e2ca6263577a
base-tree: https://git.u-boot-project.org/u-boot/u-boot.git next
change-id: 20261117-fastboot-block-check-dev-c55137e546c0

Best regards,

Signature · 1 line
David Lechner <[email protected]>
#2 lore raw
Quoted 6 lines · Guillaume La Roque

On Tue, 17 Nov 2026 18:08:01 -0600, David Lechner <[email protected]> wrote:

Hi David,

this patch is already part of an other serie :
https://lore.kernel.org/u-boot/[email protected]/

Thanks. I didn't see that one before.

Quoted 5 lines

sent before you so probably be better to use QCOM patch and put you review on it.

what do you think ?

Of course. :-)

Quoted 3 lines

Guillaume