mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	gpio: idt3243x: Fix return value check in idt_gpio_probe()
In case of error, the function devm_platform_ioremap_resource_byname()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Fixes: 4195926aed ("gpio: Add support for IDT 79RC3243x GPIO controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
			
			
This commit is contained in:
		
							parent
							
								
									354cb6465a
								
							
						
					
					
						commit
						622096fdff
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -142,8 +142,8 @@ static int idt_gpio_probe(struct platform_device *pdev) | |||
| 		return -ENOMEM; | ||||
| 
 | ||||
| 	ctrl->gpio = devm_platform_ioremap_resource_byname(pdev, "gpio"); | ||||
| 	if (!ctrl->gpio) | ||||
| 		return -ENOMEM; | ||||
| 	if (IS_ERR(ctrl->gpio)) | ||||
| 		return PTR_ERR(ctrl->gpio); | ||||
| 
 | ||||
| 	ctrl->gc.parent = dev; | ||||
| 
 | ||||
|  | @ -160,8 +160,8 @@ static int idt_gpio_probe(struct platform_device *pdev) | |||
| 
 | ||||
| 	if (device_property_read_bool(dev, "interrupt-controller")) { | ||||
| 		ctrl->pic = devm_platform_ioremap_resource_byname(pdev, "pic"); | ||||
| 		if (!ctrl->pic) | ||||
| 			return -ENOMEM; | ||||
| 		if (IS_ERR(ctrl->pic)) | ||||
| 			return PTR_ERR(ctrl->pic); | ||||
| 
 | ||||
| 		parent_irq = platform_get_irq(pdev, 0); | ||||
| 		if (!parent_irq) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Wei Yongjun
						Wei Yongjun