mhvtl
mhvtl copied to clipboard
STK library serial number inquiry should not return trailing zero bytes
The change below fixes wrong vpd allocation of 18 bytes insted of 12.
diff --git a/usr/stklxx_pm.c b/usr/stklxx_pm.c index 3f16e02..559b792 100644 --- a/usr/stklxx_pm.c +++ b/usr/stklxx_pm.c @@ -34,7 +34,7 @@ static void update_stk_l_vpd_80(struct lu_phy_attr *lu) *lu_vpd = NULL; } - *lu_vpd = alloc_vpd(0x12); + *lu_vpd = alloc_vpd(12); if (*lu_vpd) { d = (*lu_vpd)->data; /* d[4 - 15] Serial number of device */
That looks off by one byte. The snprintf() after that can use 13 bytes