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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140529140337.f999bfaaf9ffabce071962ea@linux-foundation.org>
Date:	Thu, 29 May 2014 14:03:37 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc:	Mark Fasheh <mfasheh@...e.com>, Joel Becker <jlbec@...lplan.org>,
	ocfs2-devel@....oracle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: ocfs2: move_extents.c:  Fix to remove null pointer
 checks that could never happen

On Tue, 27 May 2014 22:23:51 +0200 Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se> wrote:

> Removal of null pointer checks that could never happen

How do you know it never happens?

> --- a/fs/ocfs2/move_extents.c
> +++ b/fs/ocfs2/move_extents.c
> @@ -904,9 +904,6 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context)
>  	struct buffer_head *di_bh = NULL;
>  	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
>  
> -	if (!inode)
> -		return -ENOENT;
> -

If it's due to assuming that the previous statement would have oopsed
then that is mistaken.  Is is sometimes the case that gcc will move the
evaluation of inode->i_sb to after the test, so this function can be
passed NULL and it will not oops.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ