mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	nvmem: core: return error code instead of NULL from nvmem_device_get
nvmem_device_get() should return ERR_PTR() on error or valid pointer on success, but one of the code path seems to return NULL, so fix it. Reported-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									0181cfd93c
								
							
						
					
					
						commit
						ca6ac25cec
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -679,7 +679,7 @@ static struct nvmem_device *nvmem_find(const char *name)
 | 
			
		|||
	d = bus_find_device_by_name(&nvmem_bus_type, NULL, name);
 | 
			
		||||
 | 
			
		||||
	if (!d)
 | 
			
		||||
		return NULL;
 | 
			
		||||
		return ERR_PTR(-ENOENT);
 | 
			
		||||
 | 
			
		||||
	return to_nvmem_device(d);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue