chan_sip: Delete unneeded check
authorBadalyan Vyacheslav <v.badalyan@open-bs.ru>
Thu, 8 Dec 2016 18:54:06 +0000 (18:54 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 8 Dec 2016 19:17:40 +0000 (13:17 -0600)
P is always true. We check it before

Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb

channels/chan_sip.c

index 7f22b96..1566b54 100644 (file)
@@ -6885,10 +6885,9 @@ static int update_call_counter(struct sip_pvt *fup, int event)
                ast_log(LOG_ERROR, "update_call_counter(%s, %d) called with no event!\n", name, event);
        }
 
-       if (p) {
-               ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "SIP/%s", p->name);
-               sip_unref_peer(p, "update_call_counter: sip_unref_peer from call counter");
-       }
+       ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "SIP/%s", p->name);
+       sip_unref_peer(p, "update_call_counter: sip_unref_peer from call counter");
+
        return 0;
 }