[PATCH 5.15 504/511] platform/mellanox: mlxbf-pmc: Fix potential buffer overflows