netmap_mem_unmap: fix NULL pointer dereference

MFC after:	3 days
This commit is contained in:
vmaffione 2020-01-26 21:34:46 +00:00
parent b616c3e0b2
commit f1f3c50834

View File

@ -1523,11 +1523,12 @@ static int
netmap_mem_unmap(struct netmap_obj_pool *p, struct netmap_adapter *na)
{
int i, lim = p->objtotal;
struct netmap_lut *lut = &na->na_lut;
struct netmap_lut *lut;
if (na == NULL || na->pdev == NULL)
return 0;
lut = &na->na_lut;
#if defined(__FreeBSD__)
/* On FreeBSD mapping and unmapping is performed by the txsync
* and rxsync routine, packet by packet. */