Explorar o código

serial: bfin_sport_uart: Use resource size to fix off-by-one error

Use the resource_size function instead of manually calculating the
resource size. This actually fixes an off-by-one error.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tobias Klauser %!s(int64=15) %!d(string=hai) anos
pai
achega
e114474cf5
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      drivers/serial/bfin_sport_uart.c

+ 1 - 2
drivers/serial/bfin_sport_uart.c

@@ -774,8 +774,7 @@ static int __devinit sport_uart_probe(struct platform_device *pdev)
 			goto out_error_free_peripherals;
 		}
 
-		sport->port.membase = ioremap(res->start,
-			res->end - res->start);
+		sport->port.membase = ioremap(res->start, resource_size(res));
 		if (!sport->port.membase) {
 			dev_err(&pdev->dev, "Cannot map sport IO\n");
 			ret = -ENXIO;