[PATCH 1/4] boot: android: fix extra command line support

Nicolas Belin
2024-12-11T18:54:25Z

Check that the value at the address kcmdline_extra is not 0
instead of checking the address value itself keeping it
consistent with what is done for kcmdline.

Fixes: b36b227b ("android: boot: support extra command line")
Signed-off-by: Nicolas Belin <nbelin@baylibre.com>
---
boot/image-android.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/image-android.c b/boot/image-android.c
index cd01278f211d63262f2bdad7aa1176e2c1bbfedd..57158280b41c6552c82838e21384d925d5f7cde4 100644
--- a/boot/image-android.c
+++ b/boot/image-android.c
@@ -292,7 +292,7 @@ int android_image_get_kernel(const void *hdr,
len += strlen(img_data.kcmdline);
}

- if (img_data.kcmdline_extra) {
+ if (*img_data.kcmdline_extra) {
printf("Kernel extra command line: %s\n", img_data.kcmdline_extra);
len += strlen(img_data.kcmdline_extra);
}
@@ -316,7 +316,7 @@ int android_image_get_kernel(const void *hdr,
if (*img_data.kcmdline)
strcat(newbootargs, img_data.kcmdline);

- if (img_data.kcmdline_extra) {
+ if (*img_data.kcmdline_extra) {
strcat(newbootargs, " ");
strcat(newbootargs, img_data.kcmdline_extra);
}

--
2.34.1