mirror of
https://github.com/opnsense/src.git
synced 2026-06-07 07:42:26 -04:00
netmap: Fix error handling in nm_os_extmem_create()
We bump the object reference count prior to mapping it into the kernel map, at which point the vm_map_entry owns the reference. Then, if vm_map_wire() fails, vm_map_remove() will release the reference, so we should avoid decrementing it in the error path. Reported by: Ilja van Sprundel <ivansprundel@ioactive.com> Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53066 (cherry picked from commit dfc1041c08ba32f24b8050b4d635a0bbbfd9b767)
This commit is contained in:
parent
56b4719076
commit
6e1f47765d
1 changed files with 1 additions and 0 deletions
|
|
@ -738,6 +738,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pools_info *pi, int *perror)
|
|||
|
||||
out_rem:
|
||||
vm_map_remove(kernel_map, e->kva, e->kva + e->size);
|
||||
e->obj = NULL; /* reference consumed by vm_map_remove() */
|
||||
out_rel:
|
||||
vm_object_deallocate(e->obj);
|
||||
e->obj = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue