|
@@ -149,7 +149,7 @@ int nl_srv_unregister(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler)
|
|
|
*/
|
|
|
int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
|
|
|
{
|
|
|
- int err;
|
|
|
+ int err = 0;
|
|
|
|
|
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0))
|
|
|
NETLINK_CB(skb).pid = 0; /* sender's pid */
|
|
@@ -158,7 +158,8 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
|
|
|
#endif
|
|
|
NETLINK_CB(skb).dst_group = 0; /* not multicast */
|
|
|
|
|
|
- err = netlink_unicast(nl_srv_sock, skb, dst_pid, flag);
|
|
|
+ if (nl_srv_sock)
|
|
|
+ err = netlink_unicast(nl_srv_sock, skb, dst_pid, flag);
|
|
|
|
|
|
if (err < 0)
|
|
|
CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_WARN,
|
|
@@ -174,7 +175,7 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
|
|
|
*/
|
|
|
int nl_srv_bcast(struct sk_buff *skb)
|
|
|
{
|
|
|
- int err;
|
|
|
+ int err = 0;
|
|
|
int flags = GFP_KERNEL;
|
|
|
|
|
|
if (in_interrupt() || irqs_disabled() || in_atomic())
|
|
@@ -187,9 +188,9 @@ int nl_srv_bcast(struct sk_buff *skb)
|
|
|
#endif
|
|
|
NETLINK_CB(skb).dst_group = WLAN_NLINK_MCAST_GRP_ID; /* destination group */
|
|
|
|
|
|
- err =
|
|
|
- netlink_broadcast(nl_srv_sock, skb, 0, WLAN_NLINK_MCAST_GRP_ID,
|
|
|
- flags);
|
|
|
+ if (nl_srv_sock)
|
|
|
+ err = netlink_broadcast(nl_srv_sock, skb, 0,
|
|
|
+ WLAN_NLINK_MCAST_GRP_ID, flags);
|
|
|
|
|
|
if (err < 0) {
|
|
|
CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_WARN,
|