drbd: check return of kmalloc in receive_uuids
Signed-off-by: Jing Wang <windsdaemon@gmail.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
		
					parent
					
						
							
								986836503e
							
						
					
				
			
			
				commit
				
					
						063eacf88c
					
				
			
		
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -3663,6 +3663,10 @@ static int receive_uuids(struct drbd_tconn *tconn, struct packet_info *pi)
 | 
			
		|||
		return config_unknown_volume(tconn, pi);
 | 
			
		||||
 | 
			
		||||
	p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO);
 | 
			
		||||
	if (!p_uuid) {
 | 
			
		||||
		dev_err(DEV, "kmalloc of p_uuid failed\n");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++)
 | 
			
		||||
		p_uuid[i] = be64_to_cpu(p->uuid[i]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue