public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Sibi Sankar <sibis@codeaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: pdr_register_listener(): Integer handling issues
Date: Mon, 13 Apr 2020 09:23:22 -0700	[thread overview]
Message-ID: <202004130923.13CDE2C9@keescook> (raw)

Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20200413 as part of the linux-next weekly 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 Mar 12 17:38:40 2020 +0530
    fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")

Coverity reported the following:

*** CID 1461652:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/drivers/soc/qcom/pdr_interface.c: 158 in pdr_register_listener()
152     	if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
153     		pr_err("PDR: %s register listener failed: 0x%x\n",
154     		       pds->service_path, resp.resp.error);
155     		return ret;
156     	}
157
vvv     CID 1461652:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
vvv     "(int)resp.curr_state < -2147483648 /* -((int)(~0U >> 1)) - 1 */" is always false regardless of the values of its operands. This occurs as the logical first operand of "||".
158     	if ((int)resp.curr_state < INT_MIN || (int)resp.curr_state > INT_MAX)
159     		pr_err("PDR: %s notification state invalid: 0x%x\n",
160     		       pds->service_path, resp.curr_state);
161
162     	pds->state = resp.curr_state;
163

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: 1461652 ("Integer handling issues")
Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2020-04-13 16:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202004130923.13CDE2C9@keescook \
    --to=keescook@chromium.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-next@vger.kernel.org \
    --cc=sibis@codeaurora.org \
    /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