]> git.baikalelectronics.ru Git - kernel.git/commit
skd: fix msix error handling
authorArnd Bergmann <arnd@arndb.de>
Wed, 9 Nov 2016 12:55:34 +0000 (13:55 +0100)
committerJens Axboe <axboe@fb.com>
Thu, 10 Nov 2016 05:53:45 +0000 (22:53 -0700)
commit4344a6aaf1e626932a8f61da845fcb0e3e919b1f
tree6c359501445272e2b60dc139ac51f888f6173599
parent29b3d5ef557796e00823221424765561b4940bae
skd: fix msix error handling

As reported by gcc -Wmaybe-uninitialized, the cleanup path for
skd_acquire_msix tries to free the already allocated msi-x vectors
in reverse order, but the index variable may not have been
used yet:

drivers/block/skd_main.c: In function ‘skd_acquire_irq’:
drivers/block/skd_main.c:3890:8: error: ‘i’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This changes the failure path to skip releasing the interrupts
if we have not started requesting them yet.

Fixes: 68fa2a5cff8d ("skd: use pci_alloc_irq_vectors")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/skd_main.c