pmc_common: Recycle message if allocation of tlv_extra failed
Change-Id: I4ed12f1cddcb85e8f55552ce8980a9d5f3f7d800 Signed-off-by: Andriy Kohut <andriyk@mellanox.com>
This commit is contained in:
		
							parent
							
								
									f32553b70a
								
							
						
					
					
						commit
						f977a653e0
					
				@ -506,6 +506,7 @@ int pmc_send_get_action(struct pmc *pmc, int id)
 | 
				
			|||||||
	extra = tlv_extra_alloc();
 | 
						extra = tlv_extra_alloc();
 | 
				
			||||||
	if (!extra) {
 | 
						if (!extra) {
 | 
				
			||||||
		pr_err("failed to allocate TLV descriptor");
 | 
							pr_err("failed to allocate TLV descriptor");
 | 
				
			||||||
 | 
							msg_put(msg);
 | 
				
			||||||
		return -ENOMEM;
 | 
							return -ENOMEM;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	extra->tlv = (struct TLV *) msg->management.suffix;
 | 
						extra->tlv = (struct TLV *) msg->management.suffix;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user