mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-24 04:30:23 +00:00
Staging: rspiusb: Fix buffer overflow
usb_buffer_map_sg() may return -1. This will result in a read from pdx->PixelUrb[frameInfo][-1] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
5fb4d2525b
commit
749d00dbf1
@ -716,6 +716,8 @@ static int MapUserBuffer(struct ioctl_struct *io, struct device_extension *pdx)
|
||||
pdx->PixelUrb[frameInfo][i]->transfer_flags =
|
||||
URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT;
|
||||
}
|
||||
if (i == 0)
|
||||
return -EINVAL;
|
||||
/* only interrupt when last URB completes */
|
||||
pdx->PixelUrb[frameInfo][--i]->transfer_flags &= ~URB_NO_INTERRUPT;
|
||||
pdx->pendedPixelUrbs[frameInfo] =
|
||||
|
Loading…
Reference in New Issue
Block a user