Do not return out of bound pointers from intr_lookup_source().
This hardens the code against driver and upper level bugs causing invalid indexes used, e.g. on msi release. Reported by: gallatin Reviewed by: gallatin, hselasky Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14470
This commit is contained in:
parent
3c41c1d446
commit
33099716f3
@ -178,6 +178,8 @@ struct intsrc *
|
||||
intr_lookup_source(int vector)
|
||||
{
|
||||
|
||||
if (vector < 0 || vector >= nitems(interrupt_sources))
|
||||
return (NULL);
|
||||
return (interrupt_sources[vector]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user