Skip to content

Commit 7ed2d91

Browse files
t-gianPaolo Abeni
authored andcommitted
qed: fix possible uninit pointer read in qed_mcp_nvm_info_populate()
Coverity reports an uninit pointer read in qed_mcp_nvm_info_populate(). If EOPNOTSUPP is returned from qed_mcp_bist_nvm_get_num_images() ensure nvm_info.num_images is set to 0 to avoid possible uninit assignment to p_hwfn->nvm_info.image_att later on in out label. Closes: https://scan5.scan.coverity.com/#/project-view/63204/10063?selectedIssue=1636666 Suggested-by: Simon Horman <[email protected]> Signed-off-by: Gianfranco Trad <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 0cb2c50 commit 7ed2d91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,6 +3358,7 @@ int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn)
33583358
p_ptt, &nvm_info.num_images);
33593359
if (rc == -EOPNOTSUPP) {
33603360
DP_INFO(p_hwfn, "DRV_MSG_CODE_BIST_TEST is not supported\n");
3361+
nvm_info.num_images = 0;
33613362
goto out;
33623363
} else if (rc || !nvm_info.num_images) {
33633364
DP_ERR(p_hwfn, "Failed getting number of images\n");

0 commit comments

Comments
 (0)