mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	gpio-mcp23s08: correctly handling failed allocation
Since devm_kzalloc can be failed in memory pressure, it needs to check and return -ENOMEM Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
		
							parent
							
								
									818cc6a5f8
								
							
						
					
					
						commit
						aaf2b3afb9
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -803,6 +803,8 @@ static int mcp230xx_probe(struct i2c_client *client, | |||
| 			pdata = devm_kzalloc(&client->dev, | ||||
| 					sizeof(struct mcp23s08_platform_data), | ||||
| 					GFP_KERNEL); | ||||
| 			if (!pdata) | ||||
| 				return -ENOMEM; | ||||
| 			pdata->base = -1; | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Insu Yun
						Insu Yun