Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Kumar, M Chetan" <m.chetan.kumar@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Solomon Ucko <solly.ucko@gmail.com>
Cc: linuxwwan <linuxwwan@intel.com>,
Loic Poulain <loic.poulain@linaro.org>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"security@kernel.org" <security@kernel.org>
Subject: RE: [PATCH net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()
Date: Mon, 16 Aug 2021 10:48:20 +0000 [thread overview]
Message-ID: <SJ0PR11MB5008D7714F0D224A0778857ED7FD9@SJ0PR11MB5008.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210816092610.GA26746@kili>
Hi Dan,
> +++ b/drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c
> @@ -64,10 +64,9 @@ static struct ipc_chnl_cfg modem_cfg[] = {
>
> int ipc_chnl_cfg_get(struct ipc_chnl_cfg *chnl_cfg, int index) {
> - int array_size = ARRAY_SIZE(modem_cfg);
> -
> - if (index >= array_size) {
> - pr_err("index: %d and array_size %d", index, array_size);
> + if (index >= ARRAY_SIZE(modem_cfg)) {
> + pr_err("index: %d and array_size %lu", index,
array_size is removed so please change array_size in pr_err to array size (remove _).
Also change in pr_err array size format "%lu" is throwing warning [1] in 32bit env.
[1]
from ../drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c:6:
../drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c: In function 'ipc_chnl_cfg_get':
../include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type
'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
Regards,
Chetan
next prev parent reply other threads:[~2021-08-16 10:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANtMP6qvcE+u61+HUyEFNu15kQ02a1P5_mGRSHuyeCxkf4pQbA@mail.gmail.com>
2021-08-16 9:26 ` Dan Carpenter
2021-08-16 10:48 ` Kumar, M Chetan [this message]
2021-08-16 11:13 ` [PATCH v2 " Dan Carpenter
2021-08-16 12:17 ` Kumar, M Chetan
2021-08-16 12:50 ` patchwork-bot+netdevbpf
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=SJ0PR11MB5008D7714F0D224A0778857ED7FD9@SJ0PR11MB5008.namprd11.prod.outlook.com \
--to=m.chetan.kumar@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=ryazanov.s.a@gmail.com \
--cc=security@kernel.org \
--cc=solly.ucko@gmail.com \
--subject='RE: [PATCH net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()' \
/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
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).