public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Shukun Tan <tanshukun1@huawei.com>
Cc: Zaibo Xu <xuzaibo@huawei.com>,
	Zhou Wang <wangzhou1@hisilicon.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: qm_vf_q_assign(): Error handling issues
Date: Fri, 17 Apr 2020 14:58:38 -0700	[thread overview]
Message-ID: <202004171458.44E8EB82@keescook> (raw)

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

             reply	other threads:[~2020-04-17 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 21:58 coverity-bot [this message]
2020-04-18  3:54 ` Coverity: qm_vf_q_assign(): Error handling issues Shukun Tan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202004171458.44E8EB82@keescook \
    --to=keescook@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-next@vger.kernel.org \
    --cc=tanshukun1@huawei.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox