diff --git a/kmod/agnocast.c b/kmod/agnocast.c index 3f03eb81..598979ed 100644 --- a/kmod/agnocast.c +++ b/kmod/agnocast.c @@ -259,9 +259,9 @@ static struct publisher_info * insert_publisher_info( static bool is_subscriber_referencing(struct entry_node * en) { - // Since referencing_subscriber_ids always stores entries in order from the lowest index, - // if there's nothing at index 0, it means it doesn't exist. - return (en->referencing_subscriber_ids[0] > 0); + // The referencing_subscriber_ids array is always populated starting from the smallest index. + // Therefore, an empty element at index 0 is equivalent to a non-existent referencing subscriber. + return (en->referencing_subscriber_ids[0] != -1); } static void remove_referencing_subscriber_by_index(struct entry_node * en, int index)