linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] rtla: Fix uninitialized variable found
@ 2023-07-27 15:01 Colin Ian King
  2023-07-31 15:08 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-07-27 15:01 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira, Steven Rostedt, Andreas Schwab,
	linux-trace-kernel
  Cc: kernel-janitors, linux-kernel

Variable found is not being initialized, in the case where the desired
mount is not found the variable contains garbage. Fix this by initializing
it to zero.

Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 tools/tracing/rtla/src/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c
index 623a38908ed5..c769d7b3842c 100644
--- a/tools/tracing/rtla/src/utils.c
+++ b/tools/tracing/rtla/src/utils.c
@@ -538,7 +538,7 @@ static const int find_mount(const char *fs, char *mp, int sizeof_mp)
 {
 	char mount_point[MAX_PATH];
 	char type[100];
-	int found;
+	int found = 0;
 	FILE *fp;
 
 	fp = fopen("/proc/mounts", "r");
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] rtla: Fix uninitialized variable found
  2023-07-27 15:01 [PATCH][next] rtla: Fix uninitialized variable found Colin Ian King
@ 2023-07-31 15:08 ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bristot de Oliveira @ 2023-07-31 15:08 UTC (permalink / raw)
  To: Colin Ian King, Steven Rostedt, linux-trace-kernel
  Cc: kernel-janitors, linux-kernel, Andreas Schwab

On 7/27/23 17:01, Colin Ian King wrote:
> Variable found is not being initialized, in the case where the desired
> mount is not found the variable contains garbage. Fix this by initializing
> it to zero.
> 
> Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>

Thanks!
-- Daniel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-31 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27 15:01 [PATCH][next] rtla: Fix uninitialized variable found Colin Ian King
2023-07-31 15:08 ` Daniel Bristot de Oliveira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).