[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231006165659.GX13795@ziepe.ca>
Date: Fri, 6 Oct 2023 13:56:59 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
liucong2@...inos.cn, yishaih@...dia.com, brett.creeley@....com
Subject: Re: [PATCH] vfio: Fix smatch errors in vfio_combine_iova_ranges()
On Mon, Oct 02, 2023 at 04:43:25PM -0600, Alex Williamson wrote:
> smatch reports:
>
> vfio_combine_iova_ranges() error: uninitialized symbol 'last'.
> vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_end'.
> vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_start'.
>
> These errors are only reachable via invalid input, in the case of
> @last when we receive an empty rb-tree or for @comb_{start,end} if the
> rb-tree is empty or otherwise fails to produce a second node that
> reduces the gap. Add tests with warnings for these cases.
>
> Reported-by: Cong Liu <liucong2@...inos.cn>
> Link: https://lore.kernel.org/all/20230920095532.88135-1-liucong2@kylinos.cn
> Cc: Yishai Hadas <yishaih@...dia.com>
> Cc: Brett Creeley <brett.creeley@....com>
> Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
> ---
> drivers/vfio/vfio_main.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
Yeah, this is much clearer
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Thanks,
Jason
Powered by blists - more mailing lists