lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e27e80181691451eba58ece50ea4de5e@realtek.com>
Date:   Wed, 22 Nov 2023 08:39:16 +0000
From:   James Tai [戴志峰] <james.tai@...ltek.com>
To:     Dan Carpenter <dan.carpenter@...aro.org>,
        "oe-kbuild@...ts.linux.dev" <oe-kbuild@...ts.linux.dev>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Marc Zyngier" <maz@...nel.org>, Rob Herring <robh+dt@...nel.org>,
        "Krzysztof Kozlowski" <krzk@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>
CC:     "lkp@...el.com" <lkp@...el.com>,
        "oe-kbuild-all@...ts.linux.dev" <oe-kbuild-all@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: RE: [PATCH v2 3/6] irqchip: Introduce RTD1319 support using the Realtek common interrupt controller driver

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ