vmm: modify or provide safety comments

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-11-16 23:23:22 +00:00
committed by Liu Wei
parent d5f294b326
commit d05586f520
8 changed files with 43 additions and 5 deletions
+1
View File
@@ -1784,6 +1784,7 @@ impl DeviceManager {
// SAFETY: The following pair are safe because termios gets totally overwritten by tcgetattr
// and we check the return result.
let mut termios: termios = unsafe { zeroed() };
// SAFETY: see above
let ret = unsafe { tcgetattr(fd, &mut termios as *mut _) };
if ret < 0 {
return vmm_sys_util::errno::errno_result();