mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[S390] qdio: Sanitize do_QDIO sanity checks
Remove unneeded sanity checks from do_QDIO since this is the hot path. Change the type of bufnr and count to unsigned int so the check for the maximum value works. Reported-by: Roel Kluin <[email protected]> Signed-off-by: Jan Glauber <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
This commit is contained in:
parent
f0a0b15e0f
commit
6618241b47
2 changed files with 3 additions and 8 deletions
|
|
@ -1497,18 +1497,13 @@ out:
|
|||
* @count: how many buffers to process
|
||||
*/
|
||||
int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
|
||||
int q_nr, int bufnr, int count)
|
||||
int q_nr, unsigned int bufnr, unsigned int count)
|
||||
{
|
||||
struct qdio_irq *irq_ptr;
|
||||
|
||||
if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) ||
|
||||
(count > QDIO_MAX_BUFFERS_PER_Q) ||
|
||||
(q_nr >= QDIO_MAX_QUEUES_PER_IRQ))
|
||||
if (bufnr >= QDIO_MAX_BUFFERS_PER_Q || count > QDIO_MAX_BUFFERS_PER_Q)
|
||||
return -EINVAL;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
||||
irq_ptr = cdev->private->qdio_data;
|
||||
if (!irq_ptr)
|
||||
return -ENODEV;
|
||||
|
|
|
|||
Loading…
Reference in a new issue