Re: [RFC PATCH] net: macb: Add null check for PCLK and HCLK
From: Harini Katakam
Date: Wed Mar 20 2019 - 06:46:35 EST
Hi Claudiu,
On Tue, Mar 19, 2019 at 9:51 PM <Claudiu.Beznea@xxxxxxxxxxxxx> wrote:
>
>
>
> On 19.03.2019 07:54, Harini Katakam wrote:
<snip>
> > - if (IS_ERR(*pclk)) {
> > + if (IS_ERR(*pclk) || (*pclk == NULL)) {
>
> You can use IS_ERR_OR_NULL() macro.
>
Yes will fix, thanks.
Also the error code from this function will end up being 0 below
even if pointer is NULL. Will fix that.
Regards,
Harini
> > err = PTR_ERR(*pclk);
> > dev_err(&pdev->dev, "failed to get macb_clk (%u)\n", err);
> > return err;
> > }