diff options
author | Sivan Reinstein <sivanr@codeaurora.org> | 2015-09-08 14:04:41 +0300 |
---|---|---|
committer | Sivan Reinstein <sivanr@codeaurora.org> | 2015-09-08 14:04:41 +0300 |
commit | 9331f6e7526d907bb8324c4805cb113a4f4f9d81 (patch) | |
tree | aad178ed1cd0dfafffdfbcf70cb1fe5393bb4b56 /ipanat | |
parent | b707257475419ad70852346cd4be4fb541421c70 (diff) | |
download | ipacfg-mgr-9331f6e7526d907bb8324c4805cb113a4f4f9d81.tar.gz |
IPACM: Fix a check of mmap call
When opening a NAT table, IPACM requests to mmap the nat device.
The failure check needs to be against MAP_FAILED and not against
NULL as a return value from mmap.
Change-Id: If8f3553c8ebb08b525d77c1ec4644bd9ee829d54
Acked-by: David Arinzon <darinzon@qti.qualcomm.com>
Diffstat (limited to 'ipanat')
-rw-r--r-- | ipanat/src/ipa_nat_drvi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipanat/src/ipa_nat_drvi.c b/ipanat/src/ipa_nat_drvi.c index 8ba2bdb..cfda3e3 100644 --- a/ipanat/src/ipa_nat_drvi.c +++ b/ipanat/src/ipa_nat_drvi.c @@ -823,7 +823,7 @@ int ipa_nati_update_cache(struct ipa_ioc_nat_alloc_mem *mem, prot, flags, fd, offset); #endif - if (NULL == ipv4_rules_addr) { + if (MAP_FAILED == ipv4_rules_addr) { perror("unable to mmap the memory\n"); return -EINVAL; } |