Re: [PATCH] rtla: Uninitialized variable in find_mount()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxx/

-- Daniel

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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux