From: coverity-bot <keescook@chromium.org>
To: Kyle Tso <kyletso@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org
Subject: Coverity: tcpm_handle_alert(): Error handling issues
Date: Tue, 8 Jun 2021 11:02:44 -0700 [thread overview]
Message-ID: <202106081102.62B7A8AB00@keescook> (raw)
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20210608 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:
Fri Jun 4 13:24:16 2021 +0200
063933f47a7a ("usb: typec: tcpm: Properly handle Alert and Status Messages")
Coverity reported the following:
*** CID 1505153: Error handling issues (CHECKED_RETURN)
/drivers/usb/typec/tcpm/tcpm.c: 2227 in tcpm_handle_alert()
2221 }
2222
2223 /* Just handling non-battery alerts for now */
2224 if (!(type & USB_PD_ADO_TYPE_BATT_STATUS_CHANGE)) {
2225 if (port->pwr_role == TYPEC_SOURCE) {
2226 port->upcoming_state = GET_STATUS_SEND;
vvv CID 1505153: Error handling issues (CHECKED_RETURN)
vvv Calling "tcpm_ams_start" without checking return value (as is done elsewhere 15 out of 17 times).
2227 tcpm_ams_start(port, GETTING_SOURCE_SINK_STATUS);
2228 } else {
2229 /*
2230 * Do not check SinkTxOk here in case the Source doesn't set its Rp to
2231 * SinkTxOk in time.
2232 */
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: 1505153 ("Error handling issues")
Fixes: 063933f47a7a ("usb: typec: tcpm: Properly handle Alert and Status Messages")
Thanks for your attention!
--
Coverity-bot
reply other threads:[~2021-06-08 18:02 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=202106081102.62B7A8AB00@keescook \
--to=keescook@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=kyletso@google.com \
--cc=linux-next@vger.kernel.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