batman-adv: hash_add() has to discriminate on the return value
[deliverable/linux.git] / net / batman-adv / vis.c
index 8a1b98589d7627de6faf6cafc1f14f0bf416bed2..8b75cc562053e70033ab0737f5bc9114a4a61474 100644 (file)
@@ -465,7 +465,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,
        /* try to add it */
        hash_added = hash_add(bat_priv->vis_hash, vis_info_cmp, vis_info_choose,
                              info, &info->hash_entry);
-       if (hash_added < 0) {
+       if (hash_added != 0) {
                /* did not work (for some reason) */
                kref_put(&info->refcount, free_info);
                info = NULL;
@@ -920,7 +920,7 @@ int vis_init(struct bat_priv *bat_priv)
        hash_added = hash_add(bat_priv->vis_hash, vis_info_cmp, vis_info_choose,
                              bat_priv->my_vis_info,
                              &bat_priv->my_vis_info->hash_entry);
-       if (hash_added < 0) {
+       if (hash_added != 0) {
                pr_err("Can't add own vis packet into hash\n");
                /* not in hash, need to remove it manually. */
                kref_put(&bat_priv->my_vis_info->refcount, free_info);
This page took 0.037052 seconds and 5 git commands to generate.