thunderbolt: Handle NULL boot ACL entries properly
authorMika Westerberg <[email protected]>
Tue, 15 May 2018 13:04:25 +0000 (16:04 +0300)
committerGreg Kroah-Hartman <[email protected]>
Tue, 15 May 2018 16:02:00 +0000 (18:02 +0200)
If the boot ACL entry is already NULL we should not fill in the upper
two DWs with 0xfffffffff. Otherwise they are not shown as empty entries
when the sysfs attribute is read.

Fixes: 9aaa3b8b4c56 ("thunderbolt: Add support for preboot ACL")
Signed-off-by: Mika Westerberg <[email protected]>
Acked-by: Yehezkel Bernat <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/thunderbolt/icm.c

index 2d2ceda9aa2691ed3b7d38752a74bcaf06955547..500911f1649852d91641e607be198228b9e185a2 100644 (file)
@@ -1255,7 +1255,7 @@ static int icm_ar_get_boot_acl(struct tb *tb, uuid_t *uuids, size_t nuuids)
                        /* Map empty entries to null UUID */
                        uuid[0] = 0;
                        uuid[1] = 0;
-               } else {
+               } else if (uuid[0] != 0 || uuid[1] != 0) {
                        /* Upper two DWs are always one's */
                        uuid[2] = 0xffffffff;
                        uuid[3] = 0xffffffff;