linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtla: Uninitialized variable in find_mount()
@ 2023-07-31 14:11 Dan Carpenter
  2023-07-31 15:11 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-07-31 14:11 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira
  Cc: Steven Rostedt, Andreas Schwab, linux-trace-kernel,
	kernel-janitors

The "found" variable needs to be set to 0/false at the start.

Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 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] rtla: Uninitialized variable in find_mount()
  2023-07-31 14:11 [PATCH] rtla: Uninitialized variable in find_mount() Dan Carpenter
@ 2023-07-31 15:11 ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bristot de Oliveira @ 2023-07-31 15:11 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steven Rostedt, Andreas Schwab, linux-trace-kernel,
	kernel-janitors

On 7/31/23 16:11, Dan Carpenter wrote:
> The "found" variable needs to be set to 0/false at the start.
> 
> Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  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;

Same problem, right? https://lore.kernel.org/lkml/20230727150117.627730-1-colin.i.king@gmail.com/

-- Daniel

>  
>  	fp = fopen("/proc/mounts", "r");


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 14:11 [PATCH] rtla: Uninitialized variable in find_mount() Dan Carpenter
2023-07-31 15:11 ` 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).