mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	gpio-amd8111: check ioport_map return value
ioport_map() may fail. Its safe to check the return value. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
		
							parent
							
								
									da9df93e9e
								
							
						
					
					
						commit
						ffe4770b9b
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -213,6 +213,11 @@ static int __init amd_gpio_init(void)
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
 | 
						gp.pm = ioport_map(gp.pmbase + PMBASE_OFFSET, PMBASE_SIZE);
 | 
				
			||||||
 | 
						if (!gp.pm) {
 | 
				
			||||||
 | 
							dev_err(&pdev->dev, "Couldn't map io port into io memory\n");
 | 
				
			||||||
 | 
							err = -ENOMEM;
 | 
				
			||||||
 | 
							goto out;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	gp.pdev = pdev;
 | 
						gp.pdev = pdev;
 | 
				
			||||||
	gp.chip.dev = &pdev->dev;
 | 
						gp.chip.dev = &pdev->dev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue