Commit c3a11c0e authored by Dan Carpenter's avatar Dan Carpenter Committed by Steve French

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 8a3c4e44
...@@ -467,16 +467,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -467,16 +467,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
kref_put(&old_iface->refcount, release_iface); kref_put(&old_iface->refcount, release_iface);
} else if (!chan_index) { } else if (!chan_index) {
/* special case: update interface for primary channel */ /* special case: update interface for primary channel */
if (iface) {
cifs_dbg(FYI, "referencing primary channel iface: %pIS\n", cifs_dbg(FYI, "referencing primary channel iface: %pIS\n",
&iface->sockaddr); &iface->sockaddr);
iface->num_channels++; iface->num_channels++;
iface->weight_fulfilled++; iface->weight_fulfilled++;
} }
}
spin_unlock(&ses->iface_lock); spin_unlock(&ses->iface_lock);
if (iface) {
spin_lock(&ses->chan_lock); spin_lock(&ses->chan_lock);
chan_index = cifs_ses_get_chan_index(ses, server); chan_index = cifs_ses_get_chan_index(ses, server);
if (chan_index == CIFS_INVAL_CHAN_INDEX) { if (chan_index == CIFS_INVAL_CHAN_INDEX) {
...@@ -486,7 +483,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) ...@@ -486,7 +483,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
ses->chans[chan_index].iface = iface; ses->chans[chan_index].iface = iface;
spin_unlock(&ses->chan_lock); spin_unlock(&ses->chan_lock);
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment