diff options
| author | Mattijs Korpershoek <[email protected]> | 2024-07-24 11:51:06 +0200 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2024-08-22 09:23:33 +0200 |
| commit | 61faa6dd21f661cab95aa00a6660441a5f04f8db (patch) | |
| tree | d705ef7ff236566e5b8b84436b800b1690beea8f /include/linux | |
| parent | 0b06e052fb153958d470209dab237f12796cb0da (diff) | |
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: dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields")
Reviewed-by: Dmitrii Merkurev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
