]> git.baikalelectronics.ru Git - uboot.git/commit
part: Add check for NULL dev_part_str
authorSean Anderson <seanga2@gmail.com>
Sat, 15 May 2021 18:13:54 +0000 (14:13 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 26 May 2021 21:26:07 +0000 (17:26 -0400)
commite4965ade7bbe20f3561431088769c551245bd7b6
treede1445c07026f8560505516b883685397fbbcb34
parent91c45ac6b5b0d9eeb66b54b9361a9ce4e9f05b05
part: Add check for NULL dev_part_str

Some callers (e.g. cmd/fs.c) of fs_set_blk_dev may use a NULL dev_part_str.
While blk_get_device_part_str handles this fine,
part_get_info_by_dev_and_name does not. This fixes commands crashing when
implicitly using bootdevice.

The unit test has also been updated to set bootdevice to a known value and
to restore it after we are done.

Fixes: d72f563c8d ("cmd: fs: Use part_get_info_by_dev_and_name_or_num to parse partitions")
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
disk/part.c
test/dm/part.c