Skip to content

Commit c46bfba

Browse files
wangkeqidavem330
authored andcommitted
connector: Fix proc_event_num_listeners count not cleared
When we register a cn_proc listening event, the proc_event_num_listener variable will be incremented by one, but if PROC_CN_MCAST_IGNORE is not called, the count will not decrease. This will cause the proc_*_connector function to take the wrong path. It will reappear when the forkstat tool exits via ctrl + c. We solve this problem by determining whether there are still listeners to clear proc_event_num_listener. Signed-off-by: wangkeqi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 059d37b commit c46bfba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/connector/cn_proc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ static inline void send_msg(struct cn_msg *msg)
108108
filter_data[1] = 0;
109109
}
110110

111-
cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
112-
cn_filter, (void *)filter_data);
111+
if (cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT,
112+
cn_filter, (void *)filter_data) == -ESRCH)
113+
atomic_set(&proc_event_num_listeners, 0);
113114

114115
local_unlock(&local_event.lock);
115116
}

0 commit comments

Comments
 (0)