From: kernel test robot <lkp@intel.com>
To: James Morse <james.morse@arm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Fenghua Yu <fenghuay@nvidia.com>,
Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>,
Ben Horgan <ben.horgan@arm.com>
Subject: drivers/resctrl/mpam_devices.c:127:35-38: WARNING: Suspicious code. resource_size is maybe missing with msc_res
Date: Fri, 27 Nov 2026 20:57:32 +0100 [thread overview]
Message-ID: <20261127205221.92qYTzCE-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 822ba3a89c7896b26e4beb70e2ebffb881924dfe
commit: f04046f2577a5c76167333ca99d3903ee5331ba0 arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate
date: 1 year ago
config: arm64-randconfig-r2111-20261127 (https://download.01.org/0day-ci/archive/20261127/20261127205221.92qYTzCE-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 3a9f981aab0cc32f74ffac36a87891cda8889c37)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: f04046f2577a ("arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261127205221.92qYTzCE-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/resctrl/mpam_devices.c:127:35-38: WARNING: Suspicious code. resource_size is maybe missing with msc_res
vim +127 drivers/resctrl/mpam_devices.c
79
80 static struct mpam_msc *do_mpam_msc_drv_probe(struct platform_device *pdev)
81 {
82 int err;
83 u32 tmp;
84 struct mpam_msc *msc;
85 struct resource *msc_res;
86 struct device *dev = &pdev->dev;
87
88 lockdep_assert_held(&mpam_list_lock);
89
90 msc = devm_kzalloc(&pdev->dev, sizeof(*msc), GFP_KERNEL);
91 if (!msc)
92 return ERR_PTR(-ENOMEM);
93
94 err = devm_mutex_init(dev, &msc->probe_lock);
95 if (err)
96 return ERR_PTR(err);
97
98 err = devm_mutex_init(dev, &msc->part_sel_lock);
99 if (err)
100 return ERR_PTR(err);
101
102 msc->id = pdev->id;
103 msc->pdev = pdev;
104 INIT_LIST_HEAD_RCU(&msc->all_msc_list);
105 INIT_LIST_HEAD_RCU(&msc->ris);
106
107 update_msc_accessibility(msc);
108 if (cpumask_empty(&msc->accessibility)) {
109 dev_err_once(dev, "MSC is not accessible from any CPU!");
110 return ERR_PTR(-EINVAL);
111 }
112
113 if (device_property_read_u32(&pdev->dev, "pcc-channel", &tmp))
114 msc->iface = MPAM_IFACE_MMIO;
115 else
116 msc->iface = MPAM_IFACE_PCC;
117
118 if (msc->iface == MPAM_IFACE_MMIO) {
119 void __iomem *io;
120
121 io = devm_platform_get_and_ioremap_resource(pdev, 0,
122 &msc_res);
123 if (IS_ERR(io)) {
124 dev_err_once(dev, "Failed to map MSC base address\n");
125 return ERR_CAST(io);
126 }
> 127 msc->mapped_hwpage_sz = msc_res->end - msc_res->start;
128 msc->mapped_hwpage = io;
129 } else {
130 return ERR_PTR(-EINVAL);
131 }
132
133 list_add_rcu(&msc->all_msc_list, &mpam_all_msc);
134 platform_set_drvdata(pdev, msc);
135
136 return msc;
137 }
138
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-27 19:57 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=20261127205221.92qYTzCE-lkp@intel.com \
--to=lkp@intel.com \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=fenghuay@nvidia.com \
--cc=james.morse@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tan.shaopeng@jp.fujitsu.com \
/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.