From: Dan Carpenter <dan.carpenter@oracle.com>
To: viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org
Subject: [bug report] OPP: Use generic key finding helpers for level key
Date: Mon, 13 Jun 2022 16:22:18 +0300 [thread overview]
Message-ID: <Yqc6CgShqb/RId3D@kili> (raw)
Hello Viresh Kumar,
The patch b26e72f76892: "OPP: Use generic key finding helpers for
level key" from Jun 2, 2022, leads to the following Smatch static
checker warning:
drivers/opp/core.c:688 dev_pm_opp_find_level_ceil()
warn: passing casted pointer 'level' to '_find_key_ceil()' 32 vs 64.
drivers/opp/core.c
678 * ERANGE: no match found for search
679 * ENODEV: if device not found in list of registered devices
680 *
681 * The callers are required to call dev_pm_opp_put() for the returned OPP after
682 * use.
683 */
684 struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
685 unsigned int *level)
^^^^^^^^^^^^^^^^^^^^
686 {
687 return _find_key_ceil(dev, (unsigned long *)level, 0, true,
^^^^^^^^^^^^^^^^^^^^^^
This will corrupt memory.
Fortunately, there are not callers so we are safe... Can we just delete
this instead of fixing the corruption?
--> 688 _read_level);
689 }
regards,
dan carpenter
next reply other threads:[~2022-06-13 17:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 13:22 Dan Carpenter [this message]
2022-06-14 2:46 ` [bug report] OPP: Use generic key finding helpers for level key Viresh Kumar
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=Yqc6CgShqb/RId3D@kili \
--to=dan.carpenter@oracle.com \
--cc=linux-pm@vger.kernel.org \
--cc=viresh.kumar@linaro.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;
as well as URLs for NNTP newsgroup(s).