Skip to content

Commit 49a81f7

Browse files
committed
lk2nd: boot: Properly fix NULL partlabels instead of skipping them
1 parent 3d77e8b commit 49a81f7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lk2nd/boot/boot.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,15 @@ static void lk2nd_scan_devices(void)
3535
if (!bdev->is_leaf)
3636
continue;
3737

38-
/* Skip partitions without label. */
39-
if (NULL == bdev->label)
40-
continue;
41-
4238
/*
4339
* Skip partitions that are too small to have a boot fs on.
4440
*
4541
* 'boot' partition is explicitly allowed to have a small fs on it
4642
* in case one installs next stage bootloader package (i.e. u-boot)
4743
* there but still wants to make use of lk2nd's device database.
4844
*/
49-
if (bdev->size < LK2ND_BOOT_MIN_SIZE && !!strncmp(bdev->label, "boot", strlen("boot")))
45+
if (bdev->size < LK2ND_BOOT_MIN_SIZE &&
46+
!(bdev->label && !strncmp(bdev->label, "boot", strlen("boot"))))
5047
continue;
5148

5249
snprintf(mountpoint, sizeof(mountpoint), "/%s", bdev->name);

0 commit comments

Comments
 (0)