提交 a750cfde 编写于 作者: D Daniel Jurgens 提交者: James Morris

IB/core: Fix static analysis warning in ib_policy_change_task

ib_get_cached_subnet_prefix can technically fail, but the only way it
could is not possible based on the loop conditions. Check the return
value before using the variable sp to resolve a static analysis warning.

-v1:
- Fix check to !ret. Paul Moore

Fixes: 8f408ab6 ("selinux lsm IB/core: Implement LSM notification
system")
Signed-off-by: NDaniel Jurgens <danielj@mellanox.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NPaul Moore <paul@paul-moore.com>
Signed-off-by: NJames Morris <james.l.morris@oracle.com>
上级 79d0636a
......@@ -376,7 +376,8 @@ static void ib_policy_change_task(struct work_struct *work)
WARN_ONCE(ret,
"ib_get_cached_subnet_prefix err: %d, this should never happen here\n",
ret);
ib_security_cache_change(dev, i, sp);
if (!ret)
ib_security_cache_change(dev, i, sp);
}
}
up_read(&lists_rwsem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册