vmm_dev: work around a bogus error with gcc 6.3.0

The error is:
vmm_dev.c: In function 'alloc_memseg':
vmm_dev.c:261:11: error: null argument where non-null required (argument 1) [-Werror=nonnull]

Apparently, the gcc is unable to figure out that if a ternary operator
produced a non-NULL value once, then the operator with exactly the same
operands would produce the same value again.

MFC after:	1 week
This commit is contained in:
Andriy Gapon 2017-01-20 13:21:27 +00:00
parent 3dfa7645c5
commit b4a5a4d0d9

View File

@ -258,7 +258,7 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg)
if (VM_MEMSEG_NAME(mseg)) {
sysmem = false;
name = malloc(SPECNAMELEN + 1, M_VMMDEV, M_WAITOK);
error = copystr(VM_MEMSEG_NAME(mseg), name, SPECNAMELEN + 1, 0);
error = copystr(mseg->name, name, SPECNAMELEN + 1, 0);
if (error)
goto done;
}