Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cifs: Silence uninitialized variable warning

This is not really a runtime issue but Smatch complains that:

fs/cifs/smb2ops.c:1740 smb2_query_symlink()
error: uninitialized symbol 'resp_buftype'.

The warning is right that it can be uninitialized... Also "err_buf"
would be NULL at this point and we're not supposed to pass NULLs to
free_rsp_buf() or it might trigger some extra output if we turn on
debugging.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Dan Carpenter and committed by
Steve French
ff361fda 1236568e

+2 -1
+2 -1
fs/cifs/smb2ops.c
··· 1700 1700 &resp_buftype); 1701 1701 if (!rc || !err_iov.iov_base) { 1702 1702 rc = -ENOENT; 1703 - goto querty_exit; 1703 + goto free_path; 1704 1704 } 1705 1705 1706 1706 err_buf = err_iov.iov_base; ··· 1741 1741 1742 1742 querty_exit: 1743 1743 free_rsp_buf(resp_buftype, err_buf); 1744 + free_path: 1744 1745 kfree(utf16_path); 1745 1746 return rc; 1746 1747 }