提交 560ac051 编写于 作者: N Namjae Jeon

ksmbd: remove unneeded NULL check in the list iterator

Remove unneeded NULL check in the list iterator. And use
list_for_each_entry_safe instead of list_for_each_safe.
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 ee81cae1
......@@ -30,15 +30,12 @@ struct ksmbd_session_rpc {
static void free_channel_list(struct ksmbd_session *sess)
{
struct channel *chann;
struct list_head *tmp, *t;
list_for_each_safe(tmp, t, &sess->ksmbd_chann_list) {
chann = list_entry(tmp, struct channel, chann_list);
if (chann) {
list_del(&chann->chann_list);
kfree(chann);
}
struct channel *chann, *tmp;
list_for_each_entry_safe(chann, tmp, &sess->ksmbd_chann_list,
chann_list) {
list_del(&chann->chann_list);
kfree(chann);
}
}
......
......@@ -76,7 +76,7 @@ struct channel *lookup_chann_list(struct ksmbd_session *sess, struct ksmbd_conn
struct channel *chann;
list_for_each_entry(chann, &sess->ksmbd_chann_list, chann_list) {
if (chann && chann->conn == conn)
if (chann->conn == conn)
return chann;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册