diff options
Diffstat (limited to 'Documentation/connector/cn_test.c')
| -rw-r--r-- | Documentation/connector/cn_test.c | 15 | 
1 files changed, 7 insertions, 8 deletions
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c index 7764594778d..d12cc944b69 100644 --- a/Documentation/connector/cn_test.c +++ b/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 @@ -146,7 +145,7 @@ static void cn_test_timer_func(unsigned long __data)  		memcpy(m + 1, data, m->len); -		cn_netlink_send(m, 0, GFP_ATOMIC); +		cn_netlink_send(m, 0, 0, GFP_ATOMIC);  		kfree(m);  	}  | 
