@@ -1822,11 +1822,6 @@ int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
int rc = 0;
struct sess_data *sess_data;
- if (ses == NULL) {
- WARN(1, "%s: ses == NULL!", __func__);
- return -EINVAL;
- }
-
sess_data = kzalloc(sizeof(struct sess_data), GFP_KERNEL);
if (!sess_data)
return -ENOMEM;
@@ -1676,11 +1676,6 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
cifs_dbg(FYI, "Session Setup\n");
- if (!server) {
- WARN(1, "%s: server is NULL!\n", __func__);
- return -EIO;
- }
-
sess_data = kzalloc(sizeof(struct SMB2_sess_data), GFP_KERNEL);
if (!sess_data)
return -ENOMEM;
The cifs_setup_session() is the only caller of .sess_setup(), and it's already ensure the server and sess not null, so remove the redundant nullptr check. Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> --- fs/cifs/sess.c | 5 ----- fs/cifs/smb2pdu.c | 5 ----- 2 files changed, 10 deletions(-)