From: "James Tai [戴志峰]" <james.tai@realtek.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
"oe-kbuild@lists.linux.dev" <oe-kbuild@lists.linux.dev>,
Thomas Gleixner <tglx@linutronix.de>,
"Marc Zyngier" <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: "lkp@intel.com" <lkp@intel.com>,
"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: RE: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver
Date: Wed, 22 Nov 2023 08:39:16 +0000 [thread overview]
Message-ID: <e27e80181691451eba58ece50ea4de5e@realtek.com> (raw)
In-Reply-To: <a045008a-5a97-4903-b5e4-a761f7e4c20a@suswa.mountain>
Hi Dan,
>smatch warnings:
>drivers/irqchip/irq-realtek-intc-common.c:179 realtek_intc_probe() warn:
>ignoring unreachable code.
>drivers/irqchip/irq-realtek-intc-common.c:187 realtek_intc_probe() warn:
>'data->base' from of_iomap() not released on lines: 176,182.
>
>vim +179 drivers/irqchip/irq-realtek-intc-common.c
>
>40e5ff4eaef72b James Tai 2023-11-18 155 int realtek_intc_probe(struct
>platform_device *pdev, const struct realtek_intc_info *info) 40e5ff4eaef72b
>James Tai 2023-11-18 156 {
>40e5ff4eaef72b James Tai 2023-11-18 157 struct realtek_intc_data
>*data;
>40e5ff4eaef72b James Tai 2023-11-18 158 struct device *dev =
>&pdev->dev;
>40e5ff4eaef72b James Tai 2023-11-18 159 struct device_node *node
>= dev->of_node;
>40e5ff4eaef72b James Tai 2023-11-18 160 int ret, i;
>40e5ff4eaef72b James Tai 2023-11-18 161
>40e5ff4eaef72b James Tai 2023-11-18 162 data = devm_kzalloc(dev,
>struct_size(data, subset_data, info->cfg_num), GFP_KERNEL);
>40e5ff4eaef72b James Tai 2023-11-18 163 if (!data)
>40e5ff4eaef72b James Tai 2023-11-18 164 return
>-ENOMEM;
>40e5ff4eaef72b James Tai 2023-11-18 165
>40e5ff4eaef72b James Tai 2023-11-18 166 data->base =
>of_iomap(node, 0);
>40e5ff4eaef72b James Tai 2023-11-18 167 if (!data->base)
>40e5ff4eaef72b James Tai 2023-11-18 168 return
>-ENOMEM;
>40e5ff4eaef72b James Tai 2023-11-18 169
>40e5ff4eaef72b James Tai 2023-11-18 170 data->info = info;
>40e5ff4eaef72b James Tai 2023-11-18 171
>40e5ff4eaef72b James Tai 2023-11-18 172
>raw_spin_lock_init(&data->lock);
>40e5ff4eaef72b James Tai 2023-11-18 173
>40e5ff4eaef72b James Tai 2023-11-18 174 data->domain =
>irq_domain_add_linear(node, 32, &realtek_intc_domain_ops, data);
>40e5ff4eaef72b James Tai 2023-11-18 175 if (!data->domain)
>40e5ff4eaef72b James Tai 2023-11-18 176 return
>-ENOMEM;
>40e5ff4eaef72b James Tai 2023-11-18 177
>40e5ff4eaef72b James Tai 2023-11-18 178 data->subset_data_num
>= info->cfg_num;
>40e5ff4eaef72b James Tai 2023-11-18 @179 for (i = 0; i <
>info->cfg_num; i++) {
>40e5ff4eaef72b James Tai 2023-11-18 180 ret =
>realtek_intc_subset(node, data, i);
>40e5ff4eaef72b James Tai 2023-11-18 181 WARN(ret,
>"failed to init subset %d: %d", i, ret);
>40e5ff4eaef72b James Tai 2023-11-18 182 return
>-ENOMEM;
>
>This loop just returns -ENOMEM. Missing if statement?
>No clean up either. Needs to release resources before returning.
I will fix it in next patches.
Thank you for your feedback.
Regards,
James
next prev parent reply other threads:[~2023-11-22 8:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 16:27 [PATCH v2 0/6] Initial support for the Realtek interrupt controller James Tai
2023-11-17 16:27 ` [PATCH v2 1/6] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs James Tai
2023-11-17 17:32 ` Rob Herring
2023-11-18 13:32 ` James Tai [戴志峰]
2023-11-18 1:37 ` kernel test robot
2023-11-19 12:47 ` Krzysztof Kozlowski
2023-11-20 9:08 ` James Tai [戴志峰]
2023-12-02 16:18 ` James Tai [戴志峰]
2023-12-03 15:04 ` Krzysztof Kozlowski
2023-12-03 15:56 ` James Tai [戴志峰]
2023-12-03 16:32 ` Krzysztof Kozlowski
2023-12-05 8:43 ` James Tai [戴志峰]
2023-12-05 8:47 ` Krzysztof Kozlowski
2023-12-06 15:07 ` James Tai [戴志峰]
2023-12-06 17:48 ` Krzysztof Kozlowski
2023-12-07 5:59 ` James Tai [戴志峰]
2023-12-02 16:39 ` James Tai [戴志峰]
2023-12-02 16:42 ` James Tai [戴志峰]
2023-11-17 16:27 ` [PATCH v2 2/6] irqchip: Add interrupt controller " James Tai
2023-11-17 16:27 ` [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver James Tai
2023-11-20 16:18 ` Dan Carpenter
2023-11-22 8:39 ` James Tai [戴志峰] [this message]
2024-01-03 9:45 ` Dan Carpenter
2023-11-17 16:27 ` [PATCH v2 4/6] irqchip: Introduce RTD1319D " James Tai
2023-11-17 16:27 ` [PATCH v2 5/6] irqchip: Introduce RTD1325 " James Tai
2023-11-17 16:27 ` [PATCH v2 6/6] irqchip: Introduce RTD1619B " James Tai
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=e27e80181691451eba58ece50ea4de5e@realtek.com \
--to=james.tai@realtek.com \
--cc=conor+dt@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=maz@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
/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).