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]
Date:   Sat, 27 May 2017 18:41:28 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <yehezkel.bernat@...el.com>,
        Lukas Wunner <lukas@...ner.de>,
        Amir Levy <amir.jer.levy@...el.com>,
        Andy Lutomirski <luto@...nel.org>,
        Mario Limonciello <Mario.Limonciello@...l.com>,
        Jared.Dominguez@...l.com,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 07/27] thunderbolt: Allow passing NULL to tb_ctl_free()

On Fri, May 26, 2017 at 7:09 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:
> Following the usual pattern used in many places, we allow passing NULL
> pointer to tb_ctl_free(). Then the user can call the function regardless
> if it has allocated control channel or not making the code bit simpler.
>

+Suggested-by as you mentioned in cover letter?

> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> ---
>  drivers/thunderbolt/ctl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
> index 889a32dd21e7..f8290a577b2b 100644
> --- a/drivers/thunderbolt/ctl.c
> +++ b/drivers/thunderbolt/ctl.c
> @@ -520,6 +520,10 @@ struct tb_ctl *tb_ctl_alloc(struct tb_nhi *nhi, hotplug_cb cb, void *cb_data)
>  void tb_ctl_free(struct tb_ctl *ctl)
>  {
>         int i;
> +
> +       if (!ctl)
> +               return;
> +
>         if (ctl->rx)
>                 ring_free(ctl->rx);
>         if (ctl->tx)
> --
> 2.11.0
>



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ