From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 19 Nov 2020 20:36:16 -0500 Subject: [PATCH 1/4] fs: btrfs: inode: handle uninitialized type before returning it In-Reply-To: <20201031010752.23974-2-wqu@suse.com> References: <20201031010752.23974-1-wqu@suse.com> <20201031010752.23974-2-wqu@suse.com> Message-ID: <20201120013616.GL32272@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Oct 31, 2020 at 09:07:49AM +0800, Qu Wenruo wrote: > In btrfs_lookup_path() the local variable @type should always be updated > after we hit any file/dir. > > But if @filename is NULL from the very beginning, then we don't > initialize it and return it directly. > > To prevent such problem from happening, we initialize @type to > BTRFS_FT_UNKNOWN. > For normal execution route, it will get updated for each filename we > resolved. > Buf if we didn't find any path, we check if the type is still FT_UNKNOWN > and ret == 0. If true we know there is something wrong, just return > -EUCLEAN to inform the caller. > > Reported-by: Coverity CID 312958 > Signed-off-by: Qu Wenruo > Reviewed-by: Marek Beh?n Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: