From: Jim Snow Date: Tue, 18 Nov 2014 13:51:08 +0000 (+0100) Subject: sb_edac: Fix off-by-one error in number of channels X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=50043e257cedb54af8e1545de38f1289d0a52bc4;p=linux-beck.git sb_edac: Fix off-by-one error in number of channels This prevented edac sysfs code from properly handling 6 channels per memory controller. Signed-off-by: Jim Snow Signed-off-by: Lukasz Anaczkowski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index a6cd36100663..670d2829c547 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -372,7 +372,7 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci, { int err, chan; - if (csrow->nr_channels >= EDAC_NR_CHANNELS) + if (csrow->nr_channels > EDAC_NR_CHANNELS) return -ENODEV; csrow->dev.type = &csrow_attr_type;