]> git.karo-electronics.de Git - karo-tx-linux.git/commit
CIFS: Don't free volume_info->UNC until we are entirely done with it.
authorJesper Juhl <jj@chaosbits.net>
Sat, 27 Aug 2011 16:58:34 +0000 (18:58 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Sep 2011 13:12:44 +0000 (15:12 +0200)
commit535cc9dc3a2bad73a006f124c35f07d8edfcf8c5
tree540ac6e9faf5652cd7f935f8f2bf28681b7def01
parent18df7b82e25c641b5d16bb611d5511244266aea9
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>
fs/cifs/connect.c