HomeFreeBSD

Fix ENA driver error handling in attach and basic style fixes

Description

Fix ENA driver error handling in attach and basic style fixes

The patch contains following changes:

  • In conditional checks, always check for NULL or 0 instead of negating values
  • Use malloc and free explicitely, instead of ENA_MEM_FREE and ENA_MEM_FREE (the dmadev passed to macro is never used, and could be a little misleading)
  • Always check for NULL after calling malloc (few checks were missing)
  • Rework naming of the goto tags in ena_attach() for consistency
  • Fix error handling in ena_attach() - few goto instructions were leading to the wrong tag
  • Destroy MMIO req read request if attach failed
  • Remove checking for NULL after calling malloc with M_WAITOK flag

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon.com, Inc.
Differential Revision: https://reviews.freebsd.org/D12853