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: <d608ab82-cffe-0d66-99d2-d0abd214dd0d@gmail.com>
Date:   Fri, 7 Jan 2022 06:12:42 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Hector Martin <marcan@...can.st>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        Arend van Spriel <aspriel@...il.com>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
        Wright Feng <wright.feng@...ineon.com>,
        Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Mark Kettenis <kettenis@...nbsd.org>,
        Rafał Miłecki <zajec5@...il.com>,
        Pieter-Paul Giesberts <pieter-paul.giesberts@...adcom.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Hans de Goede <hdegoede@...hat.com>,
        "John W. Linville" <linville@...driver.com>,
        "brian m. carlson" <sandals@...stytoothpaste.net>,
        "open list:TI WILINK WIRELES..." <linux-wireless@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" 
        <brcm80211-dev-list.pdl@...adcom.com>,
        SHA-cyfmac-dev-list@...ineon.com
Subject: Re: [PATCH v2 04/35] brcmfmac: firmware: Support having multiple alt
 paths

06.01.2022 20:58, Andy Shevchenko пишет:
> On Thu, Jan 6, 2022 at 7:40 PM Dmitry Osipenko <digetx@...il.com> wrote:
>> 05.01.2022 16:22, Hector Martin пишет:
>>> On 05/01/2022 07.09, Dmitry Osipenko wrote:
> 
> ...
> 
>>> I'm confused; the array size is constant. What would index contain and
>>> why would would brcm_free_alt_fw_paths use it? Just as an iterator
>>> variable instead of using a local variable? Or do you mean count?
>>
>> Yes, use index for the count of active entries in the alt_paths[].
>>
>> for (i = 0; i < alt_paths.index; i++)
>>         kfree(alt_paths.path[i]);
>>
>> alt_paths.index = 0;
>>
>> or
>>
>> while (alt_paths.index)
>>         kfree(alt_paths.path[--alt_paths.index]);
> 
> Usual pattern is
> 
>   while (x--)
>     kfree(x);
> 
> easier to read, extend (if needed).
> 

That is indeed a usual patter for the driver removal code paths. I
didn't like to have index of struct brcmf_fw underflowed, but I see now
that fwctx is dynamically created and freed during driver probe, so it
should be fine to use that usual pattern here too.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ