Commit 8dd2e58b authored by Alexey Velichayshiy's avatar Alexey Velichayshiy Committed by Steve French
Browse files

ksmbd: remove redundant DACL check in smb_check_perm_dacl



A zero value of pdacl->num_aces is already handled at the start of
smb_check_perm_dacl() so the second check is useless.

Drop the unreachable code block, no functional impact intended.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: default avatarAlexey Velichayshiy <a.velichayshiy@ispras.ru>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 0446356e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -1307,9 +1307,6 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
			granted |= le32_to_cpu(ace->access_req);
			ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size));
		}

		if (!pdacl->num_aces)
			granted = GENERIC_ALL_FLAGS;
	}

	if (!uid)