forked from mirrors/linux
		
	tipc: Return the correct errno code
When kalloc or kmemdup failed, should return ENOMEM rather than ENOBUF. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									d15fd7359a
								
							
						
					
					
						commit
						0efea3c649
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -912,7 +912,7 @@ static int link_schedule_user(struct tipc_link *l, struct tipc_msg *hdr) | ||||||
| 	skb = tipc_msg_create(SOCK_WAKEUP, 0, INT_H_SIZE, 0, | 	skb = tipc_msg_create(SOCK_WAKEUP, 0, INT_H_SIZE, 0, | ||||||
| 			      dnode, l->addr, dport, 0, 0); | 			      dnode, l->addr, dport, 0, 0); | ||||||
| 	if (!skb) | 	if (!skb) | ||||||
| 		return -ENOBUFS; | 		return -ENOMEM; | ||||||
| 	msg_set_dest_droppable(buf_msg(skb), true); | 	msg_set_dest_droppable(buf_msg(skb), true); | ||||||
| 	TIPC_SKB_CB(skb)->chain_imp = msg_importance(hdr); | 	TIPC_SKB_CB(skb)->chain_imp = msg_importance(hdr); | ||||||
| 	skb_queue_tail(&l->wakeupq, skb); | 	skb_queue_tail(&l->wakeupq, skb); | ||||||
|  | @ -1030,7 +1030,7 @@ void tipc_link_reset(struct tipc_link *l) | ||||||
|  * |  * | ||||||
|  * Consumes the buffer chain. |  * Consumes the buffer chain. | ||||||
|  * Messages at TIPC_SYSTEM_IMPORTANCE are always accepted |  * Messages at TIPC_SYSTEM_IMPORTANCE are always accepted | ||||||
|  * Return: 0 if success, or errno: -ELINKCONG, -EMSGSIZE or -ENOBUFS |  * Return: 0 if success, or errno: -ELINKCONG, -EMSGSIZE or -ENOBUFS or -ENOMEM | ||||||
|  */ |  */ | ||||||
| int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, | int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, | ||||||
| 		   struct sk_buff_head *xmitq) | 		   struct sk_buff_head *xmitq) | ||||||
|  | @ -1088,7 +1088,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, | ||||||
| 			if (!_skb) { | 			if (!_skb) { | ||||||
| 				kfree_skb(skb); | 				kfree_skb(skb); | ||||||
| 				__skb_queue_purge(list); | 				__skb_queue_purge(list); | ||||||
| 				return -ENOBUFS; | 				return -ENOMEM; | ||||||
| 			} | 			} | ||||||
| 			__skb_queue_tail(transmq, skb); | 			__skb_queue_tail(transmq, skb); | ||||||
| 			tipc_link_set_skb_retransmit_time(skb, l); | 			tipc_link_set_skb_retransmit_time(skb, l); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Zheng Yongjun
						Zheng Yongjun