All of lore.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: AngeloGioacchino Del Regno <kholk11@gmail.com>
Cc: Amit Kucheria <amit.kucheria@linaro.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: calibrate_8976(): Memory - illegal accesses
Date: Mon, 28 Oct 2019 16:03:57 -0700	[thread overview]
Message-ID: <201910281603.E90E9627A@keescook> (raw)

Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20191025 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 recent commits:

95ededc17e4e ("thermal: qcom: tsens-v1: Add support for MSM8956 and MSM8976")

Coverity reported the following:

*** CID 1487355:  Memory - illegal accesses  (USE_AFTER_FREE)
/drivers/thermal/qcom/tsens-v1.c: 245 in calibrate_8976()
239     	int mode = 0, tmp = 0;
240     	u32 *qfprom_cdata;
241
242     	qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib");
243     	if (IS_ERR(qfprom_cdata)) {
244     		kfree(qfprom_cdata);
vvv     CID 1487355:  Memory - illegal accesses  (USE_AFTER_FREE)
vvv     Passing freed pointer "qfprom_cdata" as an argument to "PTR_ERR".
245     		return PTR_ERR(qfprom_cdata);
246     	}
247
248     	mode = (qfprom_cdata[4] & MSM8976_CAL_SEL_MASK);
249     	dev_dbg(priv->dev, "calibration mode is %d\n", mode);
250

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:

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1487355 ("Memory - illegal accesses")
Fixes: 95ededc17e4e ("thermal: qcom: tsens-v1: Add support for MSM8956 and MSM8976")


Thanks for your attention!

-- 
Coverity-bot

             reply	other threads:[~2019-10-28 23:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 23:03 coverity-bot [this message]
2019-10-28 23:44 ` Coverity: calibrate_8976(): Memory - illegal accesses Gustavo A. R. Silva
2019-10-29 15:59   ` Kees Cook
2019-10-29 16:07     ` Amit Kucheria
2019-10-29 16:17       ` Kees Cook

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=201910281603.E90E9627A@keescook \
    --to=keescook@chromium.org \
    --cc=amit.kucheria@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=gustavo@embeddedor.com \
    --cc=kholk11@gmail.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 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.