Re: [PATCH v3] tools/hv: Add memory allocation check in hv_fcopy_start

2024-09-06 Thread Saurabh Singh Sengar
On Sat, Sep 07, 2024 at 12:53:02AM +, Dexuan Cui wrote: > > From: Zhu Jun > > Sent: Friday, September 6, 2024 2:14 AM > > Reviewed-by: Dexuan Cui Tested-by: Saurabh Sengar - Saurabh

Re: [PATCH v2] tools/hv: Add memory allocation check in hv_fcopy_start

2024-09-06 Thread Saurabh Singh Sengar
On Sat, Sep 07, 2024 at 12:49:59AM +, Dexuan Cui wrote: > > From: Saurabh Singh Sengar > > Sent: Wednesday, September 4, 2024 10:21 PM > > [...] > > hv_fcopy_send_data is the parent function which calls hv_fcopy_start. > > Possibly a good solution is to check the return value from > > hv_fcop

RE: [PATCH v3] tools/hv: Add memory allocation check in hv_fcopy_start

2024-09-06 Thread Dexuan Cui
> From: Zhu Jun > Sent: Friday, September 6, 2024 2:14 AM Reviewed-by: Dexuan Cui

RE: [PATCH v2] tools/hv: Add memory allocation check in hv_fcopy_start

2024-09-06 Thread Dexuan Cui
> From: Saurabh Singh Sengar > Sent: Wednesday, September 4, 2024 10:21 PM > [...] > hv_fcopy_send_data is the parent function which calls hv_fcopy_start. > Possibly a good solution is to check the return value from > hv_fcopy_send_data The return value of hv_fcopy_send_data() is saved into icms

[PATCH v3] tools/hv: Add memory allocation check in hv_fcopy_start

2024-09-06 Thread Zhu Jun
Added error handling for memory allocation failures of file_name and path_name. Signed-off-by: Zhu Jun --- v1->v2: Add cleanup memory v2->v3: If we're calling exit() just 2 lines later, it doesn't make a lot of sense to call free(). free(NULL) is valid (refer to "man