The memory allocated for temporarily keeping DPTR need to be freed after
operation.
Also, dptr need to be aligned to 8B.
Fixes: 71213a8b773c ("common/cnxk: support CPT CTX write through microcode op")
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Tejasree Kondoj <ktejasree@marvell.com>
plt_err("Couldn't allocate memory for result address");
return -ENOMEM;
}
- dptr = plt_zmalloc(sa_len, 0);
- if (!dptr) {
+
+ dptr = plt_zmalloc(sa_len, 8);
+ if (dptr == NULL) {
plt_err("Couldn't allocate memory for SA dptr");
plt_free(res);
return -ENOMEM;
}
+
for (i = 0; i < (sa_len / 8); i++)
dptr[i] = plt_cpu_to_be_64(((uint64_t *)sa_dptr)[i]);
plt_delay_ms(1);
plt_free(res);
+ plt_free(dptr);
return 0;
}