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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230216101034.3f742834@kernel.org>
Date:   Thu, 16 Feb 2023 10:10:34 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     "Yanchao Yang (杨彦超)" <Yanchao.Yang@...iatek.com>
Cc:     "Chris Feng (冯保林)" <Chris.Feng@...iatek.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "Mingliang Xu (徐明亮)" <mingliang.xu@...iatek.com>,
        "Min Dong (董敏)" <min.dong@...iatek.com>,
        "linuxwwan@...el.com" <linuxwwan@...el.com>,
        "m.chetan.kumar@...el.com" <m.chetan.kumar@...el.com>,
        "Liang Lu (吕亮)" <liang.lu@...iatek.com>,
        "Haijun Liu (刘海军)" <haijun.liu@...iatek.com>,
        "Haozhe Chang (常浩哲)" <Haozhe.Chang@...iatek.com>,
        "Hua Yang (杨华)" <Hua.Yang@...iatek.com>,
        "ryazanov.s.a@...il.com" <ryazanov.s.a@...il.com>,
        "Xiayu Zhang (张夏宇)" <Xiayu.Zhang@...iatek.com>,
        "loic.poulain@...aro.org" <loic.poulain@...aro.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "Ting Wang (王挺)" <ting.wang@...iatek.com>,
        "johannes@...solutions.net" <johannes@...solutions.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "Aiden Wang ( 王咏麒)" <Aiden.Wang@...iatek.com>,
        "Felix Chen ( 陈非)" <Felix.Chen@...iatek.com>,
        "Lambert Wang ( 王伟)" <Lambert.Wang@...iatek.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "Mingchuang Qiao (乔明闯)" 
        <Mingchuang.Qiao@...iatek.com>,
        "Guohao Zhang (张国豪)" <Guohao.Zhang@...iatek.com>
Subject: Re: [PATCH net-next v3 01/10] net: wwan: tmi: Add PCIe core

On Thu, 16 Feb 2023 12:50:44 +0000 Yanchao Yang (杨彦超) wrote:
> > > +	pci_clear_master(pdev);
> > > +	mtk_mhccif_exit(mdev);
> > > +	mtk_pci_free_irq(mdev);
> > > +	mtk_pci_bar_exit(mdev);
> > > +	pci_disable_device(pdev);
> > > +	pci_load_and_free_saved_state(pdev, &priv->saved_state);
> > > +	devm_kfree(dev, priv);
> > > +	devm_kfree(dev, mdev);  
> > 
> > Why are you using devm_ if you call kfree explicitly anyway?
> > You can save some memory by using kfree() directly.  
> devm_kzalloc(), devm_ioremap_resource(), devm_request_irq(),
> devm_gpio_request(), devm_clk_get()…..
> They will be freed automatically
> when corresponding device is freed, so you don’t have to free them
> explicitly. This also make probe error easier to handle. Is it ok?

Yes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ