瀏覽代碼

gpio: tz1090: Use resource_size to fix off-by-one

Use resource_size to fix off-by-one resource size calculation

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Axel Lin 10 年之前
父節點
當前提交
08b89fa20b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpio/gpio-tz1090.c

+ 1 - 1
drivers/gpio/gpio-tz1090.c

@@ -573,7 +573,7 @@ static int tz1090_gpio_probe(struct platform_device *pdev)
 
 	/* Ioremap the registers */
 	priv.reg = devm_ioremap(&pdev->dev, res_regs->start,
-				 res_regs->end - res_regs->start);
+				resource_size(res_regs));
 	if (!priv.reg) {
 		dev_err(&pdev->dev, "unable to ioremap registers\n");
 		return -ENOMEM;