efi_loader: check parameters in memory allocation
[platform/kernel/u-boot.git] / lib / smbios.c
index 22ca247..df3d26b 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
  *
  * Adapted from coreboot src/arch/x86/smbios.c
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -16,8 +15,6 @@
 #include <dm/uclass-internal.h>
 #endif
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /**
  * smbios_add_string() - add a string to the string area
  *
@@ -112,7 +109,7 @@ static int smbios_write_type1(ulong *current, int handle)
 {
        struct smbios_type1 *t = (struct smbios_type1 *)*current;
        int len = sizeof(struct smbios_type1);
-       char *serial_str = getenv("serial#");
+       char *serial_str = env_get("serial#");
 
        memset(t, 0, sizeof(struct smbios_type1));
        fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle);