summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Hoemann <jerry.hoemann@hpe.com>2022-06-18 11:10:53 +0200
committerJean Delvare <jdelvare@suse.de>2022-06-18 11:10:53 +0200
commitfd6f0a5f291b4aa5c7c3f8aa97e3f49542eceea0 (patch)
treeec3845db60bf46357a1e434f1e6a413678d0ede0
parent3882a45fb6b7a36ba9463ee53e46a9090ecb8d8c (diff)
downloaddmidecode-git-fd6f0a5f291b4aa5c7c3f8aa97e3f49542eceea0.tar.gz
dmioem: Incorrect use of static
The *str = "Reserved" is intended as the default value when index is outside of the array. str shouldn't retain values from an earlier invocation of the function. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> Fixes: 3e86b5d3a228 ("dmioem: Decode HPE OEM Record 203") Fixes: 4d8bdbc8b287 ("dmioem: Decode HPE OEM Record 238") Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--dmioem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/dmioem.c b/dmioem.c
index 1b4fcd8..c26fff9 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -243,7 +243,7 @@ static void dmi_hp_203_bayenc(const char *fname, u8 num)
static void dmi_hp_203_devtyp(const char *fname, unsigned int code)
{
- static const char *str = "Reserved";
+ const char *str = "Reserved";
static const char *type[] = {
"Unknown", /* 0x00 */
"Reserved",
@@ -273,7 +273,7 @@ static void dmi_hp_203_devtyp(const char *fname, unsigned int code)
static void dmi_hp_203_devloc(const char *fname, unsigned int code)
{
- static const char *str = "Reserved";
+ const char *str = "Reserved";
static const char *location[] = {
"Unknown", /* 0x00 */
"Embedded",
@@ -301,7 +301,7 @@ static void dmi_hp_203_devloc(const char *fname, unsigned int code)
static void dmi_hp_238_loc(const char *fname, unsigned int code)
{
- static const char *str = "Reserved";
+ const char *str = "Reserved";
static const char *location[] = {
"Internal", /* 0x00 */
"Front of Server",
@@ -321,7 +321,7 @@ static void dmi_hp_238_loc(const char *fname, unsigned int code)
static void dmi_hp_238_flags(const char *fname, unsigned int code)
{
- static const char *str = "Reserved";
+ const char *str = "Reserved";
static const char *flags[] = {
"Not Shared", /* 0x00 */
"Shared with physical switch",
@@ -336,7 +336,7 @@ static void dmi_hp_238_flags(const char *fname, unsigned int code)
static void dmi_hp_238_speed(const char *fname, unsigned int code)
{
- static const char *str = "Reserved";
+ const char *str = "Reserved";
static const char *speed[] = {
"Reserved", /* 0x00 */
"USB 1.1 Full Speed",