mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	Btrfs: Cocci spatch "memdup.spatch"
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
		
							parent
							
								
									97a184fe81
								
							
						
					
					
						commit
						a5959bc0a1
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3422,10 +3422,9 @@ static int __find_xattr(int num, struct btrfs_key *di_key,
 | 
			
		|||
	    strncmp(name, ctx->name, name_len) == 0) {
 | 
			
		||||
		ctx->found_idx = num;
 | 
			
		||||
		ctx->found_data_len = data_len;
 | 
			
		||||
		ctx->found_data = kmalloc(data_len, GFP_NOFS);
 | 
			
		||||
		ctx->found_data = kmemdup(data, data_len, GFP_NOFS);
 | 
			
		||||
		if (!ctx->found_data)
 | 
			
		||||
			return -ENOMEM;
 | 
			
		||||
		memcpy(ctx->found_data, data, data_len);
 | 
			
		||||
		return 1;
 | 
			
		||||
	}
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue