mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	leds: st1202: Check for error code from devm_mutex_init() call
Even if it's not critical, the avoidance of checking the error code
from devm_mutex_init() call today diminishes the point of using devm
variant of it. Tomorrow it may even leak something. Add the missed
check.
Fixes: 259230378c ("leds: Add LED1202 I2C driver")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250204-must_check-devm_mutex_init-v2-1-7b6271c4b7e6@weissschuh.net
Signed-off-by: Lee Jones <lee@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									59670b23bf
								
							
						
					
					
						commit
						8168906bbb
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -356,7 +356,9 @@ static int st1202_probe(struct i2c_client *client)
 | 
			
		|||
	if (!chip)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
	devm_mutex_init(&client->dev, &chip->lock);
 | 
			
		||||
	ret = devm_mutex_init(&client->dev, &chip->lock);
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
		return ret;
 | 
			
		||||
	chip->client = client;
 | 
			
		||||
 | 
			
		||||
	ret = st1202_dt_init(chip);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue