diff options
| author | Juergen Gross <[email protected]> | 2022-05-05 06:35:31 +0000 |
|---|---|---|
| committer | Juergen Gross <[email protected]> | 2022-05-19 12:21:37 +0000 |
| commit | 8c9eb0e3731d7140abc77cd80aeeeea8c2ff325e (patch) | |
| tree | f23308fbc65d1f87a31a636b3cf01b4815836659 | |
| parent | xen: update grant_table.h (diff) | |
| download | kernel-8c9eb0e3731d7140abc77cd80aeeeea8c2ff325e.tar.gz kernel-8c9eb0e3731d7140abc77cd80aeeeea8c2ff325e.zip | |
xen/grant-table: never put a reserved grant on the free list
Make sure a reserved grant is never put on the free list, as this could
cause hard to debug errors.
Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
| -rw-r--r-- | drivers/xen/grant-table.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 6ea31ea26008..1a1aec0a88a1 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -207,6 +207,10 @@ static inline void check_free_callbacks(void) static void put_free_entry(grant_ref_t ref) { unsigned long flags; + + if (unlikely(ref < GNTTAB_NR_RESERVED_ENTRIES)) + return; + spin_lock_irqsave(&gnttab_list_lock, flags); gnttab_entry(ref) = gnttab_free_head; gnttab_free_head = ref; |
