diff options
author | Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> | 2013-12-04 12:40:11 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2013-12-06 04:04:17 -0500 |
commit | 7f3f5240ce64b2b59e2a9a338b4a38931724192a (patch) | |
tree | 958606e908ec49d2a0e7b8c91de5c38d05fca800 /drivers/edac | |
parent | c92132f5980666c7a52ecb53d98226c9986d32cd (diff) |
amd64_edac: Fix condition to verify max channels allowed for F15 M30h
The value returned from 'f15_m30h_determine_channel' will
always be 0x3 max. The condition
(channel > 4 || channel < 0)
works as hardware never returns a value of 4, but
it leads to static checker analysis errors like
http://marc.info/?l=linux-edac&m=138607615131951&w=2.
Fix that.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
Link: http://lkml.kernel.org/r/20131203130857.GA32170@elgon.mountain
[ Boris: massage commit message a bit. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/amd64_edac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index b53d0de17e15..e2079b2dfcb4 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -1578,7 +1578,7 @@ static int f15_m30h_match_to_this_node(struct amd64_pvt *pvt, unsigned range, | |||
1578 | num_dcts_intlv, dct_sel); | 1578 | num_dcts_intlv, dct_sel); |
1579 | 1579 | ||
1580 | /* Verify we stay within the MAX number of channels allowed */ | 1580 | /* Verify we stay within the MAX number of channels allowed */ |
1581 | if (channel > 4 || channel < 0) | 1581 | if (channel > 3) |
1582 | return -EINVAL; | 1582 | return -EINVAL; |
1583 | 1583 | ||
1584 | leg_mmio_hole = (u8) (dct_cont_base_reg >> 1 & BIT(0)); | 1584 | leg_mmio_hole = (u8) (dct_cont_base_reg >> 1 & BIT(0)); |