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]
Date:   Wed, 24 Jul 2019 03:00:30 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Jia-Ju Bai <baijiaju1990@...il.com>
Cc:     rpeterso@...hat.com, agruenba@...hat.com, cluster-devel@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: gfs2: Fix a null-pointer dereference in
 gfs2_alloc_inode()

On Wed, Jul 24, 2019 at 04:43:03PM +0800, Jia-Ju Bai wrote:
> index 0acc5834f653..c07c3f4f8451 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -1728,8 +1728,9 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
>  		memset(&ip->i_res, 0, sizeof(ip->i_res));
>  		RB_CLEAR_NODE(&ip->i_res.rs_node);
>  		ip->i_rahead = 0;
> -	}
> -	return &ip->i_inode;
> +		return &ip->i_inode;
> +	} else
> +		return NULL;
>  }

No need for an else after a return.  You probably just want to
return early for the NULL case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ