[PATCH] mesh: Fix check for MAX_APP_KEYS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



appkey_key_add() checks if the number of known appkeys is smaller or equal than MAX_APP_KEYS, but it should check if it is equal or larger than MAX_APP_KEYS.
---
 mesh/appkey.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mesh/appkey.c b/mesh/appkey.c
index 2ddb1eb..7578118 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
@@ -398,7 +398,7 @@ int appkey_key_add(struct mesh_net *net, uint16_t net_idx, uint16_t app_idx,
        }
 
        if (!key) {
-               if (l_queue_length(app_keys) <= MAX_APP_KEYS)
+               if (l_queue_length(app_keys) >= MAX_APP_KEYS)
                        return MESH_STATUS_INSUFF_RESOURCES;
 
                key = app_key_new();



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux