Files
u-boot/cmd
Mattijs Korpershoek 61faa6dd21 cmd: bcb: Fix segfault on invalid block device
When blk_get_dev() fails, block NULL and gets de-referenced in
the error path by a printf(), resulting in a crash.

This can be reproduced on sandbox with:

$ ./u-boot --command "bcb load mmc 0 0"

Fix the message by using the functions arguments (iface, devnum)
instead.

Note: partition (being a global static initialized) can be used safely.

This issue has been reported by coverity [1]

[1] https://lore.kernel.org/all/20240723141844.GF989285@bill-the-cat/

Fixes: dfeb4f0d79 ("cmd: bcb: extend BCB C API to allow read/write the fields")
Reviewed-by: Dmitrii Merkurev <dimorinny@google.com>
Link: https://lore.kernel.org/r/20240724-bcb-crash-v1-1-44caff15bce4@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-08-22 09:23:33 +02:00
..
2024-07-15 12:12:17 -06:00
2024-02-15 10:38:34 +01:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-08-02 15:16:51 -03:00
2024-07-15 12:12:17 -06:00
2024-07-10 13:36:16 -06:00
2022-03-15 16:19:29 -04:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-10 13:36:14 -06:00
2024-07-15 12:12:17 -06:00
2024-03-07 09:23:10 -05:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-05-22 08:55:29 -06:00
2022-09-02 13:40:42 -04:00
2024-06-24 13:34:52 -06:00
2024-07-15 12:12:17 -06:00
2020-08-07 22:31:32 -04:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-06-04 08:09:09 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00