ksmbd: fix control flow issues in sid_to_id()
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 6 Sep 2021 23:16:26 +0000 (08:16 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 8 Sep 2021 22:16:13 +0000 (17:16 -0500)
commit4cf0ccd033d9cedef870eb8598a55851e680a173
tree6e4238388f626dbfaffe87daece6e5dfc60c63e6
parent4ffd5264e8ecb20e1826b9474c19738fdecd67e6
ksmbd: fix control flow issues in sid_to_id()

Addresses-Coverity reported Control flow issues in sid_to_id()
/fs/ksmbd/smbacl.c: 277 in sid_to_id()
271
272 if (sidtype == SIDOWNER) {
273 kuid_t uid;
274 uid_t id;
275
276 id = le32_to_cpu(psid->sub_auth[psid->num_subauth - 1]);
>>> CID 1506810:  Control flow issues  (NO_EFFECT)
>>> This greater-than-or-equal-to-zero comparison of an unsigned value
>>> is always true. "id >= 0U".
277 if (id >= 0) {
278 /*
279  * Translate raw sid into kuid in the server's user
280  * namespace.
281  */
282 uid = make_kuid(&init_user_ns, id);

Addresses-Coverity: ("Control flow issues")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smbacl.c