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: <CAHk-=wjr5N-2ZKgn_gPaMapprn1vbBxzsdp4fJY+2iC=1H2T5g@mail.gmail.com>
Date:   Sun, 17 Sep 2023 09:46:12 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kent Gibson <warthog618@...il.com>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        akpm@...ux-foundation.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v3 1/2] gpio: sim: fix an invalid __free() usage

On Sun, 17 Sept 2023 at 02:12, Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> +               has_line_names = true;
> +               max_offset = max(line->offset, max_offset);

I really don't understand why you kept this old broken logic.

I sent a much better version of this function that didn't need that
pointless has_line_names thing or the 'max()' thing, by just making
the code a lot simpler.

Whatever.

> +       line_names_size = gpio_sim_get_line_names_size(bank);
> +       if (line_names_size) {
> +               line_names = kcalloc(line_names_size, sizeof(*line_names),
> +                                    GFP_KERNEL);
> +               if (!line_names)
> +                       return ERR_PTR(-ENOMEM);
> +
> +               gpio_sim_set_line_names(bank, line_names);
>
> -       if (line_names)
>                 properties[prop_idx++] = PROPERTY_ENTRY_STRING_ARRAY_LEN(
>                                                 "gpio-line-names",
>                                                 line_names, line_names_size);
> +       }

But I do like this reorganization.

            Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ