rasdaemon: fix mcgstatus_msg length check
Found with covscan:
ras-mce-handler.c:337: array_null: Comparing an array to null is not useful: "e->mcgstatus_msg", since the test will always evaluate as true.
Signed-off-by Aristeu Rozanski <[email protected]>
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
ras-mce-handler.c +1 -1
@@ -331,7 +331,7 @@ static void report_mce_event(struct ras_events *ras,if (e->status &MCI_STATUS_ADDRV )trace_seq_printf (s,", addr= %llx" , (long long )e->addr); -if (e->mcgstatus_msg) +if (strnlen (e->mcgstatus_msg,sizeof (e->mcgstatus_msg)))trace_seq_printf (s,", %s" , e->mcgstatus_msg);else trace_seq_printf(s, ", mcgstatus= %llx",