diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-07 21:00:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-08-07 16:12:03 -0700 |
commit | 749d00dbf154fc2f9ac59df669205039de0d5b45 (patch) | |
tree | 0099ed2a213c0b221e89a22a5b7a9611e11ddf0b /drivers | |
parent | 5fb4d2525b6dcffbb8bc26a7dfc7ed17ad323a06 (diff) | |
download | linux-749d00dbf154fc2f9ac59df669205039de0d5b45.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rspiusb/rspiusb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rspiusb/rspiusb.c b/drivers/staging/rspiusb/rspiusb.c index 2f8155c1968b..04e2f92c0f62 100644 --- a/drivers/staging/rspiusb/rspiusb.c +++ b/drivers/staging/rspiusb/rspiusb.c @@ -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] = |