mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-21 02:16:07 -04:00
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 <horms@kernel.org> Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20241215011733.351325-2-gianf.trad@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
0cb2c504d7
commit
7ed2d91588
@@ -3358,6 +3358,7 @@ int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn)
|
||||
p_ptt, &nvm_info.num_images);
|
||||
if (rc == -EOPNOTSUPP) {
|
||||
DP_INFO(p_hwfn, "DRV_MSG_CODE_BIST_TEST is not supported\n");
|
||||
nvm_info.num_images = 0;
|
||||
goto out;
|
||||
} else if (rc || !nvm_info.num_images) {
|
||||
DP_ERR(p_hwfn, "Failed getting number of images\n");
|
||||
|
||||
Reference in New Issue
Block a user