From a8b3793ddcfed4bfd935bd0ad66dd0a8aea1d881 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 26 Jun 2012 21:19:02 -0700 Subject: [PATCH] --- yaml --- r: 314637 b: refs/heads/master c: 8786395c6956ae16cd04cc8c55e0f5fcd45fa939 h: refs/heads/master i: 314635: f2c0cce18cfcb406cde99f0b131e1e51a711c9fa v: v3 --- [refs] | 2 +- trunk/Documentation/connector/cn_test.c | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 6c1f775abd34..b02062ce47a5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 85c931665d822f1bedd69ecaab09a8ba84643020 +refs/heads/master: 8786395c6956ae16cd04cc8c55e0f5fcd45fa939 diff --git a/trunk/Documentation/connector/cn_test.c b/trunk/Documentation/connector/cn_test.c index 7764594778d4..adcca0368d60 100644 --- a/trunk/Documentation/connector/cn_test.c +++ b/trunk/Documentation/connector/cn_test.c @@ -69,9 +69,13 @@ static int cn_test_want_notify(void) return -ENOMEM; } - nlh = NLMSG_PUT(skb, 0, 0x123, NLMSG_DONE, size - sizeof(*nlh)); + nlh = nlmsg_put(skb, 0, 0x123, NLMSG_DONE, size - sizeof(*nlh), 0); + if (!nlh) { + kfree_skb(skb); + return -EMSGSIZE; + } - msg = (struct cn_msg *)NLMSG_DATA(nlh); + msg = nlmsg_data(nlh); memset(msg, 0, size0); @@ -117,11 +121,6 @@ static int cn_test_want_notify(void) pr_info("request was sent: group=0x%x\n", ctl->group); return 0; - -nlmsg_failure: - pr_err("failed to send %u.%u\n", msg->seq, msg->ack); - kfree_skb(skb); - return -EINVAL; } #endif