summaryrefslogtreecommitdiff
path: root/fs/smb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-01-08 12:07:59 +0300
committerSteve French <stfrench@microsoft.com>2024-01-09 03:43:19 +0300
commitc3a11c0ec66c1e0652e3a2bb4f5cc74eea0ba486 (patch)
tree18e83982aeb5e8c3f05e92abb419d6160a756804 /fs/smb
parent8a3c4e44c243308c2364a00f9944c3d6fbdeb125 (diff)
downloadlinux-c3a11c0ec66c1e0652e3a2bb4f5cc74eea0ba486.tar.xz
cifs: delete unnecessary NULL checks in cifs_chan_update_iface()
We return early if "iface" is NULL so there is no need to check here. Delete those checks. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb')
-rw-r--r--fs/smb/client/sess.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c
index a16e175731eb..775c6a4a2f4b 100644
--- a/fs/smb/client/sess.c
+++ b/fs/smb/client/sess.c
@@ -467,27 +467,23 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
kref_put(&old_iface->refcount, release_iface);
} else if (!chan_index) {
/* special case: update interface for primary channel */
- if (iface) {
- cifs_dbg(FYI, "referencing primary channel iface: %pIS\n",
- &iface->sockaddr);
- iface->num_channels++;
- iface->weight_fulfilled++;
- }
+ cifs_dbg(FYI, "referencing primary channel iface: %pIS\n",
+ &iface->sockaddr);
+ iface->num_channels++;
+ iface->weight_fulfilled++;
}
spin_unlock(&ses->iface_lock);
- if (iface) {
- spin_lock(&ses->chan_lock);
- chan_index = cifs_ses_get_chan_index(ses, server);
- if (chan_index == CIFS_INVAL_CHAN_INDEX) {
- spin_unlock(&ses->chan_lock);
- return 0;
- }
-
- ses->chans[chan_index].iface = iface;
+ spin_lock(&ses->chan_lock);
+ chan_index = cifs_ses_get_chan_index(ses, server);
+ if (chan_index == CIFS_INVAL_CHAN_INDEX) {
spin_unlock(&ses->chan_lock);
+ return 0;
}
+ ses->chans[chan_index].iface = iface;
+ spin_unlock(&ses->chan_lock);
+
return rc;
}