{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/7851","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/7851/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/7851/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/7851/events","html_url":"https://github.com/ARMmbed/mbed-os/pull/7851","id":352735282,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5OTc0MjQ2","number":7851,"title":"littlefs: Fixed issue with cleanup in mount function on error","user":{"login":"geky","id":1075160,"node_id":"MDQ6VXNlcjEwNzUxNjA=","avatar_url":"https://avatars3.githubusercontent.com/u/1075160?v=4","gravatar_id":"","url":"https://api.github.com/users/geky","html_url":"https://github.com/geky","followers_url":"https://api.github.com/users/geky/followers","following_url":"https://api.github.com/users/geky/following{/other_user}","gists_url":"https://api.github.com/users/geky/gists{/gist_id}","starred_url":"https://api.github.com/users/geky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geky/subscriptions","organizations_url":"https://api.github.com/users/geky/orgs","repos_url":"https://api.github.com/users/geky/repos","events_url":"https://api.github.com/users/geky/events{/privacy}","received_events_url":"https://api.github.com/users/geky/received_events","type":"User","site_admin":false},"labels":[{"id":147112891,"node_id":"MDU6TGFiZWwxNDcxMTI4OTE=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20review","name":"needs: review","color":"fbca04","default":false},{"id":949783200,"node_id":"MDU6TGFiZWw5NDk3ODMyMDA=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/release-version:%205.10.0-rc1","name":"release-version: 5.10.0-rc1","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-21T22:32:09Z","updated_at":"2018-08-22T07:35:29Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/7851","html_url":"https://github.com/ARMmbed/mbed-os/pull/7851","diff_url":"https://github.com/ARMmbed/mbed-os/pull/7851.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/7851.patch"},"body":"### Description\r\n\r\nAs a part of the v1.6 update (https://github.com/ARMmbed/mbed-os/pull/7713), littlefs added proper handling for cleaning up memory in the case of an error during mount (https://github.com/ARMmbed/littlefs/pull/80). This took care of a memory leak users were seeing. Ironically, it turns out the implementation and user patterns in mbed-os was _relying_ on this memory leak to avoid a double free in the same case of an error during mount.\r\n\r\nThe issue was that a failed mount would leave the LittleFileSystem class in a state where it thought it was mounted, and later it would attempt to unmount the filesystem. With the previous memory leak this would be \"ok\", and the leaked memory would be freed. But with the fix in v1.6, no memory is leaked, and the incorrect free triggers a hard fault.\r\n\r\nFixed to clean up state properly on failed mounts.\r\n\r\n<!-- \r\n    Required\r\n    Add here detailed changes summary, testing results, dependencies \r\n    Good example: https://os.mbed.com/docs/latest/reference/workflow.html (Pull request template)\r\n-->\r\n\r\ncc @juhoeskeli, @dannybenor, @deepikabhavnani, @ARMmbed/mbed-os-storage \r\n\r\n\r\n### Pull request type\r\n\r\n<!-- \r\n    Required\r\n    Please add only one X to one of the following types. Do not fill multiple types (split the pull request otherwise).\r\n    Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front\r\n    of them would change the meaning incorrectly. The only changes to be made are to add a description text under the\r\n    description heading and to add a 'x' to the correct box.\r\n-->\r\n    [ ] Fix\r\n    [x] Fix dependent on unreleased feature\r\n    [ ] Refactor\r\n    [ ] Target update\r\n    [ ] Functionality change\r\n    [ ] Breaking change\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/414940346","html_url":"https://github.com/ARMmbed/mbed-os/pull/7851#issuecomment-414940346","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/7851","id":414940346,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDk0MDM0Ng==","user":{"login":"0xc0170","id":2963726,"node_id":"MDQ6VXNlcjI5NjM3MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/2963726?v=4","gravatar_id":"","url":"https://api.github.com/users/0xc0170","html_url":"https://github.com/0xc0170","followers_url":"https://api.github.com/users/0xc0170/followers","following_url":"https://api.github.com/users/0xc0170/following{/other_user}","gists_url":"https://api.github.com/users/0xc0170/gists{/gist_id}","starred_url":"https://api.github.com/users/0xc0170/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xc0170/subscriptions","organizations_url":"https://api.github.com/users/0xc0170/orgs","repos_url":"https://api.github.com/users/0xc0170/repos","events_url":"https://api.github.com/users/0xc0170/events{/privacy}","received_events_url":"https://api.github.com/users/0xc0170/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T07:35:29Z","updated_at":"2018-08-22T07:35:29Z","author_association":"MEMBER","body":"/morph build"}}
{"actor":{"display_login":"0xc0170"}}