Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

EDAC/versalnet: Fix off by one in handle_error()

The priv->mci[] array has NUM_CONTROLLERS so this > comparison needs to be >=
to prevent an out of bounds access.

Fixes: d5fe2fec6c40 ("EDAC: Add a driver for the AMD Versal NET DDR controller")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>

authored by

Dan Carpenter and committed by
Borislav Petkov (AMD)
79c0a2b7 3a866087

+1 -1
+1 -1
drivers/edac/versalnet_edac.c
··· 433 433 phys_addr_t pfn; 434 434 int err; 435 435 436 - if (WARN_ON_ONCE(ctl_num > NUM_CONTROLLERS)) 436 + if (WARN_ON_ONCE(ctl_num >= NUM_CONTROLLERS)) 437 437 return; 438 438 439 439 mci = priv->mci[ctl_num];