* Coverity: qm_vf_q_assign(): Error handling issues
@ 2020-04-17 21:58 coverity-bot
2020-04-18 3:54 ` Shukun Tan
0 siblings, 1 reply; 2+ messages in thread
From: coverity-bot @ 2020-04-17 21:58 UTC (permalink / raw
To: Shukun Tan
Cc: Zaibo Xu, Zhou Wang, Herbert Xu, Gustavo A. R. Silva, linux-next
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20200417 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Thu Apr 2 14:53:02 2020 +0800
cd1b7ae3435c ("crypto: hisilicon - unify SR-IOV related codes into QM")
Coverity reported the following:
*** CID 1492651: Error handling issues (CHECKED_RETURN)
/drivers/crypto/hisilicon/qm.c: 2317 in qm_vf_q_assign()
2311 for (i = 1; i <= num_vfs; i++) {
2312 if (i == num_vfs)
2313 q_num += remain_q_num % num_vfs;
2314 ret = hisi_qm_set_vft(qm, i, q_base, q_num);
2315 if (ret) {
2316 for (j = i; j > 0; j--)
vvv CID 1492651: Error handling issues (CHECKED_RETURN)
vvv Calling "hisi_qm_set_vft" without checking return value (as is done elsewhere 4 out of 5 times).
2317 hisi_qm_set_vft(qm, j, 0, 0);
2318 return ret;
2319 }
2320 q_base += q_num;
2321 }
2322
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1492651 ("Error handling issues")
Fixes: cd1b7ae3435c ("crypto: hisilicon - unify SR-IOV related codes into QM")
Thanks for your attention!
--
Coverity-bot
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Coverity: qm_vf_q_assign(): Error handling issues
2020-04-17 21:58 Coverity: qm_vf_q_assign(): Error handling issues coverity-bot
@ 2020-04-18 3:54 ` Shukun Tan
0 siblings, 0 replies; 2+ messages in thread
From: Shukun Tan @ 2020-04-18 3:54 UTC (permalink / raw
To: coverity-bot
Cc: Zaibo Xu, Zhou Wang, Herbert Xu, Gustavo A. R. Silva, linux-next
On 2020/4/18 5:58, coverity-bot wrote:
> Hello!
>
> This is an experimental semi-automated report about issues detected by
> Coverity from a scan of next-20200417 as part of the linux-next scan project:
> https://scan.coverity.com/projects/linux-next-weekly-scan
>
> You're getting this email because you were associated with the identified
> lines of code (noted below) that were touched by commits:
>
> Thu Apr 2 14:53:02 2020 +0800
> cd1b7ae3435c ("crypto: hisilicon - unify SR-IOV related codes into QM")
>
> Coverity reported the following:
>
> *** CID 1492651: Error handling issues (CHECKED_RETURN)
> /drivers/crypto/hisilicon/qm.c: 2317 in qm_vf_q_assign()
> 2311 for (i = 1; i <= num_vfs; i++) {
> 2312 if (i == num_vfs)
> 2313 q_num += remain_q_num % num_vfs;
> 2314 ret = hisi_qm_set_vft(qm, i, q_base, q_num);
> 2315 if (ret) {
> 2316 for (j = i; j > 0; j--)
> vvv CID 1492651: Error handling issues (CHECKED_RETURN)
> vvv Calling "hisi_qm_set_vft" without checking return value (as is done elsewhere 4 out of 5 times).
> 2317 hisi_qm_set_vft(qm, j, 0, 0);
This is the rollback of previous hisi_qm_set_vft failure, We will not check the retrun again.
Thanks,
Shukun
> 2318 return ret;
> 2319 }
> 2320 q_base += q_num;
> 2321 }
> 2322
>
> If this is a false positive, please let us know so we can mark it as
> such, or teach the Coverity rules to be smarter. If not, please make
> sure fixes get into linux-next. :) For patches fixing this, please
> include these lines (but double-check the "Fixes" first):
>
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1492651 ("Error handling issues")
> Fixes: cd1b7ae3435c ("crypto: hisilicon - unify SR-IOV related codes into QM")
>
> Thanks for your attention!
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-18 3:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-17 21:58 Coverity: qm_vf_q_assign(): Error handling issues coverity-bot
2020-04-18 3:54 ` Shukun Tan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.