]> git.baikalelectronics.ru Git - kernel.git/commit
FS: cifs, remove unneeded NULL tests
authorJiri Slaby <jslaby@suse.cz>
Mon, 1 Nov 2010 15:08:55 +0000 (16:08 +0100)
committerSteve French <sfrench@us.ibm.com>
Tue, 2 Nov 2010 03:47:21 +0000 (03:47 +0000)
commitb68c4437cdfbdbf7bec268aa9290a9c3c3ddd950
treeb0e77798ad82428f4f0026cf8f72cc0608ab3223
parent8e0c5d72750ca72fc1d16cd788647b03ada5b1de
FS: cifs, remove unneeded NULL tests

Stanse found that pSMBFile in cifs_ioctl and file->f_path.dentry in
cifs_user_write are dereferenced prior their test to NULL.

The alternative is not to dereference them before the tests. The patch is
to point out the problem, you have to decide.

While at it we cache the inode in cifs_user_write to a local variable
and use all over the function.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Steve French <sfrench@samba.org>
Cc: linux-cifs@vger.kernel.org
Cc: Jeff Layton <jlayton@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c
fs/cifs/ioctl.c