driver: espi: npcx: fix out-of-bounds read in espi_vw_generic_isr.

Fix out-of-bounds read in espi_vw_generic_isr func.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
This commit is contained in:
Mulin Chao 2021-03-07 17:57:54 -08:00 committed by Anas Nashif
commit 97db5d74c7

View file

@ -433,9 +433,11 @@ static void espi_vw_generic_isr(const struct device *dev, struct npcx_wui *wui)
} }
} }
if (idx == ARRAY_SIZE(vw_in_tbl)) if (idx == ARRAY_SIZE(vw_in_tbl)) {
LOG_ERR("Unknown VW event! %d %d %d", wui->table, LOG_ERR("Unknown VW event! %d %d %d", wui->table,
wui->group, wui->bit); wui->group, wui->bit);
return;
}
signal = vw_in_tbl[idx].sig; signal = vw_in_tbl[idx].sig;
if (signal == ESPI_VWIRE_SIGNAL_SLP_S3 if (signal == ESPI_VWIRE_SIGNAL_SLP_S3