IB/cache: Use correct pointer to calculate size