1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00

Don't crash with a null device pointer

This commit is contained in:
Alex Forencich 2019-12-04 13:37:53 -08:00
parent 90e2f8f5d0
commit 2fa4f595ee

View File

@ -173,6 +173,9 @@ fail_alloc:
void mqnic_close(struct mqnic *dev) void mqnic_close(struct mqnic *dev)
{ {
if (!dev)
return;
munmap((void *)dev->regs, dev->regs_size); munmap((void *)dev->regs, dev->regs_size);
close(dev->fd); close(dev->fd);
free(dev); free(dev);