1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

hptmv: Handle errors from copyout() in hpt_set_info()

This is in preparation for annotating copyin() and related functions
with __result_use_check.

MFC after:	1 week
This commit is contained in:
Mark Johnston 2023-12-26 19:00:01 -05:00
parent 2873d841f8
commit b4a9e6d814

View File

@ -338,13 +338,13 @@ hpt_set_info(int length)
if (err==0) {
if (piop->nOutBufferSize)
copyout(ke_area + piop->nInBufferSize, (void*)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize);
err = -copyout(ke_area + piop->nInBufferSize, (void*)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize);
if (piop->lpBytesReturned)
copyout(&dwRet, (void*)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD));
if (err == 0 && piop->lpBytesReturned)
err = -copyout(&dwRet, (void*)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD));
free(ke_area, M_DEVBUF);
return length;
return err == 0 ? length : err;
}
else KdPrintW(("Kernel_ioctl(): return %d\n", err));