[Feature][ZXW-241]merge P56U01 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I7985538dde6951dd824c36149bf9a1e3ca23c734
diff --git a/ap/app/clatd/ring.c b/ap/app/clatd/ring.c
index 5e99fd5..113c8ec 100755
--- a/ap/app/clatd/ring.c
+++ b/ap/app/clatd/ring.c
@@ -39,6 +39,7 @@
int ver = TPACKET_V2;
if (setsockopt(packetsock, SOL_PACKET, PACKET_VERSION, (void *) &ver, sizeof(ver))) {
logmsg(ANDROID_LOG_FATAL, "setsockopt(PACKET_VERSION, %d) failed: %s", ver, strerror(errno));
+ close(packetsock);
return -1;
}
@@ -61,6 +62,7 @@
if (setsockopt(packetsock, SOL_PACKET, PACKET_RX_RING, &req, sizeof(req)) < 0) {
logmsg(ANDROID_LOG_FATAL, "PACKET_RX_RING failed: %s", strerror(errno));
+ close(packetsock);
return -1;
}
@@ -69,6 +71,7 @@
packetsock, 0);
if (ring->base == MAP_FAILED) {
logmsg(ANDROID_LOG_FATAL, "mmap %lu failed: %s", buflen, strerror(errno));
+ close(packetsock);
return -1;
}