Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22242
b: refs/heads/master
c: b191ba0
h: refs/heads/master
v: v3
  • Loading branch information
Evgeniy Polyakov authored and David S. Miller committed Mar 21, 2006
1 parent 52ee061 commit 8c01dfd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ac81ae34ec8898e7eb1388fe21e3cee7b626a88
refs/heads/master: b191ba0d599928372be5a89f75486eb58efab48a
5 changes: 3 additions & 2 deletions trunk/Documentation/connector/connector.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ Unregisters new callback with connector core.

struct cb_id *id - unique connector's user identifier.

void cn_netlink_send(struct cn_msg *msg, u32 __groups, int gfp_mask);
int cn_netlink_send(struct cn_msg *msg, u32 __groups, int gfp_mask);

Sends message to the specified groups. It can be safely called from
any context, but may silently fail under strong memory pressure.
softirq context, but may silently fail under strong memory pressure.
If there are no listeners for given group -ESRCH can be returned.

struct cn_msg * - message header(with attached data).
u32 __group - destination group.
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/connector/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask)
group = __group;
}

if (!netlink_has_listeners(dev->nls, group))
return -ESRCH;

size = NLMSG_SPACE(sizeof(*msg) + msg->len);

skb = alloc_skb(size, gfp_mask);
Expand All @@ -111,9 +114,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask)

NETLINK_CB(skb).dst_group = group;

netlink_broadcast(dev->nls, skb, 0, group, gfp_mask);

return 0;
return netlink_broadcast(dev->nls, skb, 0, group, gfp_mask);

nlmsg_failure:
kfree_skb(skb);
Expand Down

0 comments on commit 8c01dfd

Please sign in to comment.