[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170424.154806.387657447648095027.davem@davemloft.net>
Date: Mon, 24 Apr 2017 15:48:06 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: bianpan201602@....com
Cc: f.fainelli@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, bianpan2016@....com
Subject: Re: [PATCH 1/1] net: bcmgenet: fix incorrect return value checks
From: Pan Bian <bianpan201602@....com>
Date: Sun, 23 Apr 2017 18:01:05 +0800
> From: Pan Bian <bianpan2016@....com>
>
> Function platform_get_irq() will return a negative value on errors.
> However, in function bcmgenet_probe(), 0 is considered as a flag of
> error. This patch fixes the bug by checking whether the return value of
> platform_get_irq() is less than 0.
>
> Signed-off-by: Pan Bian <bianpan2016@....com>
I'm definitely not confident enough to apply this.
On some platform zero IRQs are invalid.
There are also lots of pieces of code that check the return value ">
0" as success.
Powered by blists - more mailing lists