Commit 221278d2 authored by Colin Ian King's avatar Colin Ian King Committed by Kleber Sacilotto de Souza

UBUNTU: SAUCE: opennsl: bcm-knet: check for null sinfo to avoid a null pointer dereference

BugLink: https://launchpad.net/bugs/1718388

sinfo can potentially be null, so add a null check to avoid a null
pointer deference on sinfo->info_id.

Detected by CoverityScan CID#1456902 ("Dereference before null check")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarJuerg Haefliger <juerg.haefliger@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
[kleber: adapted for new version path]
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 23f5c376
......@@ -6357,7 +6357,8 @@ bkn_get_next_dma_event(kcom_msg_dma_info_t *kmsg)
sinfo = bkn_sinfo_from_unit(dev_no);
}
if ((sinfo->inst_id != 0) && ((sinfo->inst_id & (1 << dev_evt)) == 0)){
if (sinfo && (sinfo->inst_id != 0) &&
((sinfo->inst_id & (1 << dev_evt)) == 0)) {
DBG_INST((" %s skip dev(%d)\n",__FUNCTION__,dev_evt));
continue;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment