aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Palosaari2014-02-26 20:48:23 -0300
committerMauro Carvalho Chehab2014-03-13 10:26:53 -0300
commitd287e4e31ed6374f8899c131075461c3c8cbd8a9 (patch)
treed2352b472471fd7a5983567f643766946777c569
parent2c57213fe043d0ed9c8f4709161ac89316e6250a (diff)
[media] msi3101: clamp mmap buffers to reasonable level
That value is coming from the user and we need only ensure it is reasonable. That was pointed by Hans when reviewing rtl2832_sdr driver. Signed-off-by: Antti Palosaari <crope@iki.fi> Cc: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/staging/media/msi3101/sdr-msi3101.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c
index 2135940f2d58..93e6ebadafbe 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -831,7 +831,7 @@ static int msi3101_queue_setup(struct vb2_queue *vq,
dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers);
/* Absolute min and max number of buffers available for mmap() */
- *nbuffers = 32;
+ *nbuffers = clamp_t(unsigned int, *nbuffers, 8, 32);
*nplanes = 1;
/*
* 3, wMaxPacketSize 3x 1024 bytes