]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
i2c: emev2: add IRQ check
authorSergey Shtylyov <s.shtylyov@omprussia.ru>
Sat, 10 Apr 2021 20:16:41 +0000 (23:16 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 26 May 2021 13:39:21 +0000 (15:39 +0200)
commit1715b5bfa9663dcd6b3c2180b436cf33537f8f1e
treef515057f52267da2fcfe6bc80eccfcb6115c37b4
parentaf8f2b796c7ecacc286c019846e97e4fb1046aa6
i2c: emev2: add IRQ check

BugLink: https://bugs.launchpad.net/bugs/1929615
[ Upstream commit bb6129c32867baa7988f7fd2066cf18ed662d240 ]

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: 5faf6e1f58b4 ("i2c: emev2: add 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/i2c/busses/i2c-emev2.c