qdio: add check index of input- and output_qs[]
Quoted 13 lines · Roel Kluin
Ensure that
q_nris within the bounds of array irq_ptr->input_qs[] and ->output_qs[].Signed-off-by Roel Kluin <[email protected]>---
I didn't notice this when writing my previous patch. Should bufnr and count be larger than 0 as well?drivers/s390/cio/qdio_main.c +0
-0
drivers/s390/cio/qdio_main.c int do_QDIO(struct ccw_device *cdev, unsigned int callflags, · line 1498
Quoted 6 lines
drivers/s390/cio/qdio_main.c +1
-1@@ -1494,7 +1494,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,if ((bufnr >QDIO_MAX_BUFFERS_PER_Q ) || (count >QDIO_MAX_BUFFERS_PER_Q ) || - (q_nr >=QDIO_MAX_QUEUES_PER_IRQ )) + (q_nr >=QDIO_MAX_QUEUES_PER_IRQ ) || (q_nr <0 ))return -EINVAL ;
These are just sanity checks. I'd rather prefer to see all of them go away or have them under an #ifdef DEBUG.
But it's Jan's call. He is the maintainer of the driver.