Fixed a problem calculating the max size of a buffer in tx subsystem