Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d287e4e3 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarAntti Palosaari <crope@iki.fi>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 2c57213f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -831,7 +831,7 @@ static int msi3101_queue_setup(struct vb2_queue *vq,
	dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers);
	dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers);


	/* Absolute min and max number of buffers available for mmap() */
	/* Absolute min and max number of buffers available for mmap() */
	*nbuffers = 32;
	*nbuffers = clamp_t(unsigned int, *nbuffers, 8, 32);
	*nplanes = 1;
	*nplanes = 1;
	/*
	/*
	 *   3, wMaxPacketSize 3x 1024 bytes
	 *   3, wMaxPacketSize 3x 1024 bytes