qcacmn: Resolve static analysis issue

check null pointer for soc return val and
check array index input for out of bound access.

Change-Id: Ib1d52f70128eaf9ba24e9024440490e470fec3d4
CRs-Fixed: 3127451
This commit is contained in:
sandhu
2022-02-10 10:57:09 -08:00
committed by Madan Koyyalamudi
parent cf11e93c66
commit 9598f6b6c4
2 changed files with 13 additions and 0 deletions

View File

@@ -315,7 +315,11 @@ void DP_PRINT_STATS(const char *fmt, ...)
struct dp_soc *soc = NULL;
soc_void = cds_get_context(QDF_MODULE_ID_SOC);
if (!soc_void)
return;
soc = cdp_soc_t_to_dp_soc(soc_void);
va_start(val, fmt);
QDF_VTRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH, (char *)fmt, val);
/* writing to the buffer */