[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALLGbRL95niReU+e1+5pO_byHdoWNuzBtHr_iz_HTAU0KwV2eg@mail.gmail.com>
Date: Mon, 17 Aug 2020 21:40:42 -0700
From: Steve deRosier <derosier@...il.com>
To: Tang Bin <tangbin@...s.chinamobile.com>
Cc: Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Network Development <netdev@...r.kernel.org>,
linux-wireless <linux-wireless@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, ath10k@...ts.infradead.org
Subject: Re: [PATCH] ath10k: fix the status check and wrong return
On Mon, Aug 17, 2020 at 6:43 PM Tang Bin <tangbin@...s.chinamobile.com> wrote:
>
> Hi Kalle:
>
> 在 2020/8/17 22:26, Kalle Valo 写道:
> >> In the function ath10k_ahb_clock_init(), devm_clk_get() doesn't
> >> return NULL. Thus use IS_ERR() and PTR_ERR() to validate
> >> the returned value instead of IS_ERR_OR_NULL().
> > Why? What's the benefit of this patch? Or what harm does
> > IS_ERR_OR_NULL() create?
>
> Thanks for you reply, the benefit of this patch is simplify the code,
> because in
>
> this function, I don't think the situation of 'devm_clk_get() return
> NULL' exists.
>
I admit I'm not looking at HEAD, but at least in the two versions I've
got checked out, devm_clk_get() can theoretically return NULL. This
feels like a gratuitous change anyway, but in any case it's wrong and
could cause wrong behavior.
- Steve
Powered by blists - more mailing lists