hci_blocked_keys_clear(hdev);
 
-       for (i = 0; i < keys->key_count; ++i) {
+       for (i = 0; i < key_count; ++i) {
                struct blocked_key *b = kzalloc(sizeof(*b), GFP_KERNEL);
 
                if (!b) {
        u32 current_flags = __le32_to_cpu(cp->current_flags);
 
        bt_dev_dbg(hdev, "Set device flags %pMR (type 0x%x) = 0x%x",
-                  &cp->addr.bdaddr, cp->addr.type,
-                  __le32_to_cpu(current_flags));
+                  &cp->addr.bdaddr, cp->addr.type, current_flags);
 
        // We should take hci_dev_lock() early, I think.. conn_flags can change
        supported_flags = hdev->conn_flags;