diff --git a/adapter/uhdf2/host/src/devhost_dump.c b/adapter/uhdf2/host/src/devhost_dump.c index 6f7edd24b4a54dd787ca643ece586a5afed1c176..7c0eee5d917cc8c9236476f264be8422563b3244 100644 --- a/adapter/uhdf2/host/src/devhost_dump.c +++ b/adapter/uhdf2/host/src/devhost_dump.c @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #include "devhost_dump.h" #include "devhost_dump_reg.h" #include "hdf_base.h" @@ -132,10 +133,12 @@ static void DevHostDumpIpc(struct HdfSBuf *data) const char *dumpCmd = HdfSbufReadString(data); if (dumpCmd == NULL) { HDF_LOGE("ipc dumpCmd is NULL"); + close(fd); return; } HdfDumpIpcStat(fd, dumpCmd); + close(fd); return; }