]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
staging: gasket: Check the return value of gasket_get_bar_index()
authorOscar Carter <oscar.carter@gmx.com>
Fri, 1 May 2020 15:51:18 +0000 (17:51 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 25 May 2020 08:42:49 +0000 (10:42 +0200)
commit07dfadd84688323e4d5dd6a71bebc587387847e6
tree0960706c249f55c46e460a5351ea9858a7713d93
parenta45ef29629372650b42968d9f1a21daab5ef3462
staging: gasket: Check the return value of gasket_get_bar_index()

BugLink: https://bugs.launchpad.net/bugs/1878649
commit 769acc3656d93aaacada814939743361d284fd87 upstream.

Check the return value of gasket_get_bar_index function as it can return
a negative one (-EINVAL). If this happens, a negative index is used in
the "gasket_dev->bar_data" array.

Addresses-Coverity-ID: 1438542 ("Negative array index read")
Fixes: 9a69f5087ccc2 ("drivers/staging: Gasket driver framework + Apex driver")
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Richard Yeh <rcy@google.com>
Link: https://lore.kernel.org/r/20200501155118.13380-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/gasket/gasket_core.c