NetworkPkg/DpcDxe: Stop adding entries on allocation failure

DpcQueueDpc() expands the DPC entry free list when it is empty. If an
allocation fails after at least one entry has already been added to the
free list, the current code continues and inserts the failed allocation
result into the list.

Stop expanding the free list when an allocation fails and the free list
already contains entries. The caller can then continue with one of the
entries that was successfully allocated.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
1 file changed