From: Adrian Bunk Date: Tue, 11 Apr 2006 05:55:45 +0000 (-0700) Subject: [PATCH] video/aty/atyfb_base.c: fix an off-by-one error X-Git-Tag: v2.6.17-rc2~113 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=9ec85c03d045d5ec24d6f15649a68646aefe88ba [PATCH] video/aty/atyfb_base.c: fix an off-by-one error Fix an obvious of-by-one error spotted by the Coverity checker. Signed-off-by: Adrian Bunk Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index b39e72d..d9d7d3c 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -3400,7 +3400,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi struct atyfb_par *par; int i, rc = -ENOMEM; - for (i = ARRAY_SIZE(aty_chips); i >= 0; i--) + for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) if (pdev->device == aty_chips[i].pci_id) break;