it's better to allocate the buffer just before really use it. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>