]> asedeno.scripts.mit.edu Git - linux.git/commit
cifs: smb2ops: Fix NULL check in smb2_query_symlink
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 13 Apr 2018 15:13:29 +0000 (10:13 -0500)
committerSteve French <stfrench@microsoft.com>
Tue, 17 Apr 2018 19:44:30 +0000 (14:44 -0500)
commit0d568cd34eb04acf05c26f360d1a0f071f0bb636
treea044c5c68f8451cf9f87e3fea4b6d1272bd12750
parenta27fc14219f2e3c4a46ba9177b04d9b52c875532
cifs: smb2ops: Fix NULL check in smb2_query_symlink

The current code null checks variable err_buf, which is always null
when it is checked, hence utf16_path is free'd and the function
returns -ENOENT everytime it is called, making it impossible for the
execution path to reach the following code:

err_buf = err_iov.iov_base;

Fix this by null checking err_iov.iov_base instead of err_buf. Also,
notice that err_buf no longer needs to be initialized to NULL.

Addresses-Coverity-ID: 1467876 ("Logically dead code")
Fixes: 2d636199e400 ("cifs: Change SMB2_open to return an iov for the error parameter")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/smb2ops.c