The > should be >= or we end up writing one element beyond the end of
the interrupt_data->eventfd_ctxs[] array.
Fixes:
9a69f5087ccc ("drivers/staging: Gasket driver framework + Apex driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (IS_ERR(ctx))
return PTR_ERR(ctx);
- if (interrupt < 0 || interrupt > interrupt_data->num_interrupts)
+ if (interrupt < 0 || interrupt >= interrupt_data->num_interrupts)
return -EINVAL;
interrupt_data->eventfd_ctxs[interrupt] = ctx;
int gasket_interrupt_clear_eventfd(
struct gasket_interrupt_data *interrupt_data, int interrupt)
{
- if (interrupt < 0 || interrupt > interrupt_data->num_interrupts)
+ if (interrupt < 0 || interrupt >= interrupt_data->num_interrupts)
return -EINVAL;
interrupt_data->eventfd_ctxs[interrupt] = NULL;