X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fbatman-adv%2Fvis.c;h=f81a6b668b0c524d33f4f3b7794e2181a1897a9b;hb=320f422f629c7ed5d07b4186aa491d1e11d18a4c;hp=8a1b98589d7627de6faf6cafc1f14f0bf416bed2;hpb=12ff47e7f5fb64c566f62e6cf6a3b291c51bd337;p=pandora-kernel.git diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index 8a1b98589d76..f81a6b668b0c 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c @@ -131,7 +131,7 @@ static void vis_data_insert_interface(const uint8_t *interface, return; } - /* its a new address, add it to the list */ + /* it's a new address, add it to the list */ entry = kmalloc(sizeof(*entry), GFP_ATOMIC); if (!entry) return; @@ -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; @@ -887,10 +887,8 @@ int vis_init(struct bat_priv *bat_priv) } bat_priv->my_vis_info = kmalloc(MAX_VIS_PACKET_SIZE, GFP_ATOMIC); - if (!bat_priv->my_vis_info) { - pr_err("Can't initialize vis packet\n"); + if (!bat_priv->my_vis_info) goto err; - } bat_priv->my_vis_info->skb_packet = dev_alloc_skb(sizeof(*packet) + MAX_VIS_PACKET_SIZE + @@ -920,7 +918,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);