lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z02iNPcVHpjPtHXR@duo.ucw.cz>
Date: Mon, 2 Dec 2024 13:04:04 +0100
From: Pavel Machek <pavel@...x.de>
To: Sasha Levin <sashal@...nel.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	Filipe Manana <fdmanana@...e.com>, Qu Wenruo <wqu@...e.com>,
	David Sterba <dsterba@...e.com>, clm@...com, josef@...icpanda.com,
	linux-btrfs@...r.kernel.org
Subject: Re: [PATCH AUTOSEL 4.19 2/2] btrfs: fix warning on PTR_ERR() against
 NULL device at btrfs_control_ioctl()

Hi!

> From: Filipe Manana <fdmanana@...e.com>
> 
> [ Upstream commit 2342d6595b608eec94187a17dc112dd4c2a812fa ]
> 
> Smatch complains about calling PTR_ERR() against a NULL pointer:
> 
>   fs/btrfs/super.c:2272 btrfs_control_ioctl() warn: passing zero to 'PTR_ERR'
> 
> Fix this by calling PTR_ERR() against the device pointer only if it
> contains an error.

This patch was wrongly ported to 4.19. It is not needed there. Same
test is already performed 2 lines above.

Please drop.

BR,
								Pavel

> +++ b/fs/btrfs/super.c
> @@ -2283,7 +2283,10 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
>  					       &btrfs_root_fs_type);
>  		if (IS_ERR(device)) {
>  			mutex_unlock(&uuid_mutex);
> -			ret = PTR_ERR(device);
> +			if (IS_ERR(device))
> +				ret = PTR_ERR(device);
> +			else
> +				ret = 0;
>  			break;
>  		}
>  		ret = !(device->fs_devices->num_devices ==

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ