cuse(3): Make cuse_vmfree() NULL safe.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2022-07-13 17:54:24 +02:00
parent 0996dd7df6
commit 2ca43c3dba
2 changed files with 2 additions and 1 deletions

View File

@ -136,6 +136,7 @@ Else this function returns zero.
.Fn "cuse_vmfree" "void *"
This function frees memory allocated by
.Fn cuse_vmalloc .
This function is NULL safe.
Note that the
cuse library will internally not free the memory until the
.Fn cuse_uninit

View File

@ -269,7 +269,7 @@ cuse_vmfree(void *ptr)
int error;
int n;
if (f_cuse < 0)
if (f_cuse < 0 || ptr == NULL)
return;
CUSE_LOCK();