]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
sfp: Fix error handing in sfp_probe()
authorYueHaibing <yuehaibing@huawei.com>
Sat, 31 Oct 2020 03:10:53 +0000 (11:10 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:05:47 +0000 (12:05 +0100)
commitbcdc2fd2244ccf9408aa9ee59e6c3831a6a96ed8
tree909377abbbd14e57db730b22e643109cef094fcc
parente04ba0274fb30855e2325abf4c166d66bb9a01ce
sfp: Fix error handing in sfp_probe()

BugLink: https://bugs.launchpad.net/bugs/1905612
[ Upstream commit 9621618130bf7e83635367c13b9a6ee53935bb37 ]

gpiod_to_irq() never return 0, but returns negative in
case of error, check it and set gpio_irq to 0.

Fixes: 73970055450e ("sfp: add SFP module support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20201031031053.25264-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/phy/sfp.c