diff mbox series

rtla: Uninitialized variable in find_mount()

Message ID 53066ac3-523a-4db9-a636-9c99ef56c7c1@moroto.mountain (mailing list archive)
State Superseded
Headers show
Series rtla: Uninitialized variable in find_mount() | expand

Commit Message

Dan Carpenter July 31, 2023, 2:11 p.m. UTC
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(-)

Comments

Daniel Bristot de Oliveira July 31, 2023, 3:11 p.m. UTC | #1
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");
diff mbox series

Patch

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");