From: Laurent Vivier Date: Thu, 17 Jul 2025 15:08:03 +0000 (+0200) Subject: net/passt: Check return value of g_remove() in net_passt_cleanup() (CID 1612369) X-Git-Tag: v10.1.0-rc0~8^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f74e4f2e60c3b2c6e2f13eb115478df116148fe6;p=thirdparty%2Fqemu.git net/passt: Check return value of g_remove() in net_passt_cleanup() (CID 1612369) If g_remove() fails, use warn_report() to log an error. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Signed-off-by: Jason Wang --- diff --git a/net/passt.c b/net/passt.c index ef59d0682b..43c336e596 100644 --- a/net/passt.c +++ b/net/passt.c @@ -103,7 +103,10 @@ static void net_passt_cleanup(NetClientState *nc) #endif kill(s->pid, SIGTERM); - g_remove(s->pidfile); + if (g_remove(s->pidfile) != 0) { + warn_report("Failed to remove passt pidfile %s: %s", + s->pidfile, strerror(errno)); + } g_free(s->pidfile); g_ptr_array_free(s->args, TRUE); }