i2c: sh7760: add IRQ check
authorSergey Shtylyov <s.shtylyov@omprussia.ru>
Sat, 10 Apr 2021 20:25:10 +0000 (23:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:27 +0000 (10:40 +0200)
commitba5e61499b05cc18b629fe9442b0d23d6cc49f69
tree1ecbebda5af29623775aff5e4797e9862b72d03e
parentff7cda8dadc14dc7cbec1777c1b97dc7abd32d60
i2c: sh7760: add IRQ check

[ Upstream commit e5b2e3e742015dd2aa6bc7bcef2cb59b2de1221c ]

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which
takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
an original error code.  Stop calling devm_request_irq() with invalid
IRQ #s.

Fixes: a26c20b1fa6d ("i2c: Renesas SH7760 I2C master driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-sh7760.c