src.ctf.fs: make ds_file_munmap assert that ds_file is not NULL
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 5 Nov 2019 20:02:38 +0000 (15:02 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 15 Nov 2019 18:08:12 +0000 (13:08 -0500)
There is no reason for a NULL ds_file to ever be passed to this
function.  Make it assert that the value is not NULL, to catch potential
mistakes.

Change-Id: I9261450f35b0a5c74ba182985ecabe2b31eee0a0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/ctf/fs-src/data-stream-file.c

index 4e26d96ffc5aefdae7d7c8cc63bbd9f93c62b0f7..1dacf230e5913e58a1d01881f569d81fd49778a1 100644 (file)
@@ -58,7 +58,9 @@ int ds_file_munmap(struct ctf_fs_ds_file *ds_file)
        bt_self_component *self_comp = ds_file->self_comp;
        bt_logging_level log_level = ds_file->log_level;
 
-       if (!ds_file || !ds_file->mmap_addr) {
+       BT_ASSERT(ds_file);
+
+       if (!ds_file->mmap_addr) {
                goto end;
        }
 
This page took 0.025043 seconds and 4 git commands to generate.