As the comment says, mon_fp consumes ownership of mon_fd. Therefore, we
should set mon_fd to -1 so that we can't use it further on. Codex
complains about this logic bomb.
Cc: linux-xfs@vger.kernel.org # v7.0.0
Fixes: b9b03770197d19 ("xfs_healer: create daemon to listen for health events")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
perror(ctx->mntpoint);
goto out_mon_fd;
}
+ mon_fd = -1;
/* Increase the buffer size so that we can reduce kernel calls */
ctx->mon_buf = malloc(BUF_SIZE);