[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vco+nmN_ZRv8ggWRqw-wXtpdpebCJZXTUbHq8AVVEwm3Q@mail.gmail.com>
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