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:
parent
90e2f8f5d0
commit
2fa4f595ee
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user