From ea8e033e92b3e4907d9b66db767d9cae3d5380f2 Mon Sep 17 00:00:00 2001 From: Brian Gix Date: Thu, 11 Sep 2014 18:47:03 +0300 Subject: [PATCH] P2P: Allow p2p_get_group_num_members() to be called with NULL This make it easier to use wpa_s->p2p_group without having to check whether there is a group initialized on this wpa_s instance. Signed-off-by: Jouni Malinen --- src/p2p/p2p_group.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c index da8588aad..e19eab7db 100644 --- a/src/p2p/p2p_group.c +++ b/src/p2p/p2p_group.c @@ -981,6 +981,9 @@ u8 p2p_group_presence_req(struct p2p_group *group, unsigned int p2p_get_group_num_members(struct p2p_group *group) { + if (!group) + return 0; + return group->num_members; }