Commit 81d0664b authored by Mikhail Kobuk's avatar Mikhail Kobuk Committed by Greg Kroah-Hartman
Browse files

media: pci: ivtv: Add check for DMA map result



commit 629913d6 upstream.

In case DMA fails, 'dma->SG_length' is 0. This value is later used to
access 'dma->SGarray[dma->SG_length - 1]', which will cause out of
bounds access.

Add check to return early on invalid value. Adjust warnings accordingly.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 1932dc2f ("media: pci/ivtv: switch from 'pci_' to 'dma_' API")
Signed-off-by: default avatarMikhail Kobuk <m.kobuk@ispras.ru>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71285c02
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment