diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-07-13 16:09:05 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-07-13 16:09:05 +0200 |
commit | 86373411a23051a18ae3ed01b180f838dbcd76e7 (patch) | |
tree | fe3661ffdbdda3b6d252f125f49ebb0556b04d3a /pcap_mm.c | |
parent | ed57128990c02342e1abe7f2a3abd1568f965dc7 (diff) |
misc: fix multiple NULL pointer sparse warnings
Those are fixes for the following warnings:
pcap_mm.c:119:29: warning: Using plain integer as NULL pointer
pcap_mm.c:141:29: warning: Using plain integer as NULL pointer
ring.c:24:31: warning: Using plain integer as NULL pointer
flowtop.c:1114:22: warning: Using plain integer as NULL pointer
ifpps.c:1133:29: warning: Using plain integer as NULL pointer
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'pcap_mm.c')
-rw-r--r-- | pcap_mm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -116,7 +116,7 @@ static void __pcap_mm_prepare_access_wr(int fd, bool jumbo) if (ret != 1) panic("Cannot write file!\n"); - ptr_va_start = mmap(0, map_size, PROT_WRITE, MAP_SHARED, fd, 0); + ptr_va_start = mmap(NULL, map_size, PROT_WRITE, MAP_SHARED, fd, 0); if (ptr_va_start == MAP_FAILED) panic("mmap of file failed!"); ret = madvise(ptr_va_start, map_size, MADV_SEQUENTIAL); @@ -138,7 +138,7 @@ static void __pcap_mm_prepare_access_rd(int fd) panic("pcap dump file is not a regular file!\n"); map_size = sb.st_size; - ptr_va_start = mmap(0, map_size, PROT_READ, MAP_SHARED | MAP_LOCKED, fd, 0); + ptr_va_start = mmap(NULL, map_size, PROT_READ, MAP_SHARED | MAP_LOCKED, fd, 0); if (ptr_va_start == MAP_FAILED) panic("mmap of file failed!"); ret = madvise(ptr_va_start, map_size, MADV_SEQUENTIAL); |