[RESEND][PATCH 1/2] firmware: dmi: Prevent empty board name from being logged

From: Maciej W. Rozycki
Date: Sun Jan 02 2022 - 18:33:14 EST


Some systems do provide DMI entries for Base Board Information, however
the strings supplied are null, e.g:

Legacy DMI 2.0 present.
DMI: /, BIOS 4.51 PG 09/11/97

Do not log the slash along with the empty board name in that case as it
carries no real information. If it's important to tell an inexistent
and an empty board name apart, then all DMI information can be retrieved
from sysfs and/or with `dmidecode'.

Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxx>
---
drivers/firmware/dmi_scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-macro-ide-tty/drivers/firmware/dmi_scan.c
===================================================================
--- linux-macro-ide-tty.orig/drivers/firmware/dmi_scan.c
+++ linux-macro-ide-tty/drivers/firmware/dmi_scan.c
@@ -544,7 +544,7 @@ static void __init dmi_format_ids(char *
dmi_get_system_info(DMI_PRODUCT_NAME));

board = dmi_get_system_info(DMI_BOARD_NAME);
- if (board) {
+ if (board && *board) {
c += scnprintf(buf + c, len - c, "/");
c += print_filtered(buf + c, len - c, board);
}