aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-08-27 12:58:34 -0400
committerJiri Kosina <jkosina@suse.cz>2011-09-27 12:08:04 -0400
commit95c754545353ca7db2e12485546eac626f8461f9 (patch)
treee923f1bf64bd74fc09ba9960777f437952029431 /fs/cifs/connect.c
parentbfb9035c98906aafcd3cf22694fba2550997bf53 (diff)
CIFS: Don't free volume_info->UNC until we are entirely done with it.
In cleanup_volume_info_contents() we kfree(volume_info->UNC); and then proceed to use that variable on the very next line. This causes (at least) Coverity Prevent to complain about use-after-free of that variable (and I guess other checkers may do that as well). There's not any /real/ problem here since we are just using the value of the pointer, not actually dereferencing it, but it's still trivial to silence the tool, so why not? To me at least it also just seems nicer to defer freeing the variable until we are entirely done with it in all respects. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 633c246b6775..9bb4b10f0cda 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2877,9 +2877,9 @@ cleanup_volume_info_contents(struct smb_vol *volume_info)
2877{ 2877{
2878 kfree(volume_info->username); 2878 kfree(volume_info->username);
2879 kzfree(volume_info->password); 2879 kzfree(volume_info->password);
2880 kfree(volume_info->UNC);
2881 if (volume_info->UNCip != volume_info->UNC + 2) 2880 if (volume_info->UNCip != volume_info->UNC + 2)
2882 kfree(volume_info->UNCip); 2881 kfree(volume_info->UNCip);
2882 kfree(volume_info->UNC);
2883 kfree(volume_info->domainname); 2883 kfree(volume_info->domainname);
2884 kfree(volume_info->iocharset); 2884 kfree(volume_info->iocharset);
2885 kfree(volume_info->prepath); 2885 kfree(volume_info->prepath);