Re: [PATCH] btrfs: Fix an error pointer vs NULL check

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

 




On 5.08.20 г. 12:51 ч., Dan Carpenter wrote:
> The btrfs_get_subvol_name_from_objectid() function never
> returns NULL, it returns error pointers.  Update the check
> accordinglingly to prevent an Oops.
> 
> Fixes: ca346708eb17 ("btrfs: don't show full path of bind mounts in subvol=")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>

> ---
>  fs/btrfs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 53639de3a064..e529ddb35b87 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1475,7 +1475,7 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
>  		  BTRFS_I(d_inode(dentry))->root->root_key.objectid);
>  	subvol_name = btrfs_get_subvol_name_from_objectid(info,
>  			BTRFS_I(d_inode(dentry))->root->root_key.objectid);
> -	if (subvol_name) {
> +	if (!IS_ERR(subvol_name)) {
>  		seq_puts(seq, ",subvol=");
>  		seq_escape(seq, subvol_name, " \t\n\\");
>  		kfree(subvol_name);
> 



[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