Skip to content

[Coverity CID :215714] Unchecked return value in tests/subsys/fs/fs_api/src/test_fs_mount_flags.c #31668

@zephyrbot

Description

@zephyrbot

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/f91e9fba51e5da46ee5c6822f8656713d74a6ecf/tests/subsys/fs/fs_api/src/test_fs_mount_flags.c#L35

Category: Error handling issues
Function: test_mount_flags
Component: Tests
CID: 215714

Details:

53         zassert_equal(ret, -EROFS, "Expected EROFS", ret);
54         ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_RDWR);
55         zassert_equal(ret, -EROFS, "Expected EROFS", ret);
56         ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_READ);
57         zassert_equal(ret, 0, "Expected success", ret);
58         fs_close(&fs);
>>>     CID 215714:    (CHECKED_RETURN)
>>>     Calling "fs_unmount" without checking return value (as is done elsewhere 16 out of 20 times).
59         fs_unmount(&mp);
29         ret = fs_open(&fs, TEST_FS_MNTP"/some", FS_O_CREATE);
30         zassert_equal(ret, 0, "Expected success", ret);
31         fs_close(&fs);
32         TC_PRINT("Create other directory\n");
33         zassert_equal(ret, 0, "Expected success", ret);
34         ret = fs_mkdir(TEST_FS_MNTP"/other");
>>>     CID 215714:    (CHECKED_RETURN)
>>>     Calling "fs_unmount" without checking return value (as is done elsewhere 16 out of 20 times).
35         fs_unmount(&mp);
36    
37         /* Check fs operation on volume mounted with FS_MOUNT_FLAG_READ_ONLY */
38         mp.flags = FS_MOUNT_FLAG_READ_ONLY;
39         TC_PRINT("Mount as read-only\n");
40         ret = fs_mount(&mp);

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

Metadata

Metadata

Assignees

Labels

CoverityA Coverity detected issue or its fixbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions