[PATCH] x86/mca.c: malloc with correct pointer type
Meyer, Conrad
conrad.meyer at isilon.com
Thu Mar 13 16:35:52 UTC 2014
Another trivial one discovered by Clang.
Sponsored by: EMC/Isilon storage division
Signed-off-by: Conrad Meyer <conrad.meyer at isilon.com>
---
Had to track down where this file lived in CURRENT, since we have it in an old
location in OneFS.
---
sys/x86/x86/mca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/x86/x86/mca.c b/sys/x86/x86/mca.c
index 0e246ed..ac0b957 100644
--- a/sys/x86/x86/mca.c
+++ b/sys/x86/x86/mca.c
@@ -700,8 +700,8 @@ cmci_setup(void)
{
int i;
- cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **),
- M_MCA, M_WAITOK);
+ cmc_state = malloc((mp_maxid + 1) * sizeof(*cmc_state), M_MCA,
+ M_WAITOK);
for (i = 0; i <= mp_maxid; i++)
cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks,
M_MCA, M_WAITOK | M_ZERO);
--
1.8.5.3
More information about the freebsd-hackers
mailing list