Staging: Gasket: fix a couple off by one bugs
The > should be >= or we end up writing one element beyond the end of
the interrupt_data->eventfd_ctxs[] array.
Fixes: 9a69f5087c ("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>
This commit is contained in:
parent
97b23455cc
commit
7cc6dfd076
1 changed files with 2 additions and 2 deletions
|
|
@ -514,7 +514,7 @@ int gasket_interrupt_set_eventfd(
|
|||
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;
|
||||
|
|
@ -524,7 +524,7 @@ int gasket_interrupt_set_eventfd(
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue