OSDN Git Service

skd: Fix out of array boundary access
authorAlexander Gordeev <agordeev@redhat.com>
Wed, 19 Feb 2014 08:58:18 +0000 (09:58 +0100)
committerJens Axboe <axboe@fb.com>
Fri, 21 Feb 2014 23:45:26 +0000 (15:45 -0800)
commitc5e3035c88cbefe60ec155b3f9999413da1ee694
tree2711267f6bc9e32ef56dc92f19b2992a09b23ea8
parentf219ad82f8684334524a089c5dd1c47a9c345a91
skd: Fix out of array boundary access

When enabling MSI-X, interrupts are requested for SKD_MAX_MSIX_COUNT
entries in skdev->msix_entries array, while the number of actually
allocated entries is skdev->msix_count. This might lead to an out of
boundary access in case number of allocated entries is less than
SKD_MAX_MSIX_COUNT. This update fixes the described misbehaviour.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/skd_main.c