mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
hv:fix "missing for discarded return value" for memcpy_s and strcpy_s
It will print error information inside memcpy_s if the parameteter is invalid, the caller can not check the return value for memcpy_s/strcpy_s/strncpy_s code like this: int a(void) { return 0; } int b(void){ a(); } fix as follow: int a(void) { return 0; } int b(void){ (void)a(); } Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
@@ -59,7 +59,8 @@ static int do_copy_earlylog(struct shared_buf *dst_sbuf,
|
||||
buf_size = SBUF_HEAD_SIZE + dst_sbuf->size;
|
||||
valid_size = SBUF_HEAD_SIZE + cur_tail;
|
||||
|
||||
memcpy_s((void *)dst_sbuf, buf_size, (void *)src_sbuf, valid_size);
|
||||
(void)memcpy_s((void *)dst_sbuf, buf_size,
|
||||
(void *)src_sbuf, valid_size);
|
||||
if (dst_sbuf->tail != cur_tail)
|
||||
/* there is chance to lose new log from certain pcpu */
|
||||
dst_sbuf->tail = cur_tail;
|
||||
|
Reference in New Issue
Block a user