{"action":"created","comment":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/31307198","id":31307198,"diff_hunk":"@@ -273,19 +277,60 @@ static TEE_Result tee_svc_storage_read_head(struct tee_ta_session *sess,\n static TEE_Result tee_svc_storage_init_file(struct tee_ta_session *sess,\n \t\t\t\t\t    struct tee_obj *o,\n \t\t\t\t\t    struct tee_obj *attr_o, void *data,\n-\t\t\t\t\t    uint32_t len, uint32_t flags)\n+\t\t\t\t\t    uint32_t len)\n {\n \tTEE_Result res = TEE_SUCCESS;\n \tint fd;\n-\tint err;\n+\tint err = -1;\n \tstruct tee_svc_storage_head head;\n-\tchar *file = NULL;\n+\tchar *initfile = NULL;\n \n \tif (o == NULL || o->pobj == NULL)\n \t\treturn TEE_ERROR_BAD_PARAMETERS;\n \n \tfree(o->data);\n \n+\tinitfile = tee_svc_storage_create_filename(sess,\n+\t\t\t\t\t\t   o->pobj->obj_id,\n+\t\t\t\t\t\t   o->pobj->obj_id_len,\n+\t\t\t\t\t\t   true);\n+\n+\tif (initfile == NULL)\n+\t\treturn TEE_ERROR_OUT_OF_MEMORY;\n+\n+\terr = -1;\n+\terr = tee_file_ops.access(initfile, TEE_FS_F_OK);","path":"core/tee/tee_svc_storage.c","position":105,"original_position":105,"commit_id":"ad0750976ed538f580d84cd303ec88b2636e463f","original_commit_id":"ad0750976ed538f580d84cd303ec88b2636e463f","user":{"login":"pascal-brand-st-dev","id":6542303,"avatar_url":"https://avatars.githubusercontent.com/u/6542303?v=3","gravatar_id":"","url":"https://api.github.com/users/pascal-brand-st-dev","html_url":"https://github.com/pascal-brand-st-dev","followers_url":"https://api.github.com/users/pascal-brand-st-dev/followers","following_url":"https://api.github.com/users/pascal-brand-st-dev/following{/other_user}","gists_url":"https://api.github.com/users/pascal-brand-st-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pascal-brand-st-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascal-brand-st-dev/subscriptions","organizations_url":"https://api.github.com/users/pascal-brand-st-dev/orgs","repos_url":"https://api.github.com/users/pascal-brand-st-dev/repos","events_url":"https://api.github.com/users/pascal-brand-st-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pascal-brand-st-dev/received_events","type":"User","site_admin":false},"body":"Useless assignment","created_at":"2015-05-29T08:29:07Z","updated_at":"2015-05-29T08:29:07Z","html_url":"https://github.com/OP-TEE/optee_os/pull/287#discussion_r31307198","pull_request_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287","_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments/31307198"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/287#discussion_r31307198"},"pull_request":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287"}}},"pull_request":{"url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287","id":34826144,"html_url":"https://github.com/OP-TEE/optee_os/pull/287","diff_url":"https://github.com/OP-TEE/optee_os/pull/287.diff","patch_url":"https://github.com/OP-TEE/optee_os/pull/287.patch","issue_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/287","number":287,"state":"open","locked":false,"title":"GP Internal Core API v1.1 : TEE_CreatePersistentObject","user":{"login":"cedric-chaumont-st-dev","id":7803511,"avatar_url":"https://avatars.githubusercontent.com/u/7803511?v=3","gravatar_id":"","url":"https://api.github.com/users/cedric-chaumont-st-dev","html_url":"https://github.com/cedric-chaumont-st-dev","followers_url":"https://api.github.com/users/cedric-chaumont-st-dev/followers","following_url":"https://api.github.com/users/cedric-chaumont-st-dev/following{/other_user}","gists_url":"https://api.github.com/users/cedric-chaumont-st-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cedric-chaumont-st-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedric-chaumont-st-dev/subscriptions","organizations_url":"https://api.github.com/users/cedric-chaumont-st-dev/orgs","repos_url":"https://api.github.com/users/cedric-chaumont-st-dev/repos","events_url":"https://api.github.com/users/cedric-chaumont-st-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cedric-chaumont-st-dev/received_events","type":"User","site_admin":false},"body":"Deprecated TEE_DATA_FLAG_EXCLUSIVE\r\nReplaced by TEE__DATA_FLAG_OVERWRITE\r\n\r\nSigned-off-by: Cedric Chaumont <cedric.chaumont@st.com>","created_at":"2015-05-06T15:06:01Z","updated_at":"2015-05-29T08:29:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fdc932f5922b199382a46ff4286428897c43673","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287/commits","review_comments_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287/comments","review_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/287/comments","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/ad0750976ed538f580d84cd303ec88b2636e463f","head":{"label":"cedric-chaumont-st-dev:dev/gp11_create_pobj","ref":"dev/gp11_create_pobj","sha":"ad0750976ed538f580d84cd303ec88b2636e463f","user":{"login":"cedric-chaumont-st-dev","id":7803511,"avatar_url":"https://avatars.githubusercontent.com/u/7803511?v=3","gravatar_id":"","url":"https://api.github.com/users/cedric-chaumont-st-dev","html_url":"https://github.com/cedric-chaumont-st-dev","followers_url":"https://api.github.com/users/cedric-chaumont-st-dev/followers","following_url":"https://api.github.com/users/cedric-chaumont-st-dev/following{/other_user}","gists_url":"https://api.github.com/users/cedric-chaumont-st-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cedric-chaumont-st-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedric-chaumont-st-dev/subscriptions","organizations_url":"https://api.github.com/users/cedric-chaumont-st-dev/orgs","repos_url":"https://api.github.com/users/cedric-chaumont-st-dev/repos","events_url":"https://api.github.com/users/cedric-chaumont-st-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cedric-chaumont-st-dev/received_events","type":"User","site_admin":false},"repo":{"id":20771117,"name":"optee_os","full_name":"cedric-chaumont-st-dev/optee_os","owner":{"login":"cedric-chaumont-st-dev","id":7803511,"avatar_url":"https://avatars.githubusercontent.com/u/7803511?v=3","gravatar_id":"","url":"https://api.github.com/users/cedric-chaumont-st-dev","html_url":"https://github.com/cedric-chaumont-st-dev","followers_url":"https://api.github.com/users/cedric-chaumont-st-dev/followers","following_url":"https://api.github.com/users/cedric-chaumont-st-dev/following{/other_user}","gists_url":"https://api.github.com/users/cedric-chaumont-st-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/cedric-chaumont-st-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cedric-chaumont-st-dev/subscriptions","organizations_url":"https://api.github.com/users/cedric-chaumont-st-dev/orgs","repos_url":"https://api.github.com/users/cedric-chaumont-st-dev/repos","events_url":"https://api.github.com/users/cedric-chaumont-st-dev/events{/privacy}","received_events_url":"https://api.github.com/users/cedric-chaumont-st-dev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cedric-chaumont-st-dev/optee_os","description":"Trusted side of the TEE","fork":true,"url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os","forks_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/forks","keys_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/teams","hooks_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/hooks","issue_events_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/events","assignees_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/tags","blobs_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/languages","stargazers_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/stargazers","contributors_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/contributors","subscribers_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/subscribers","subscription_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/subscription","commits_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/merges","archive_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/downloads","issues_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/cedric-chaumont-st-dev/optee_os/releases{/id}","created_at":"2014-06-12T14:47:54Z","updated_at":"2015-05-07T07:53:43Z","pushed_at":"2015-05-28T13:52:56Z","git_url":"git://github.com/cedric-chaumont-st-dev/optee_os.git","ssh_url":"git@github.com:cedric-chaumont-st-dev/optee_os.git","clone_url":"https://github.com/cedric-chaumont-st-dev/optee_os.git","svn_url":"https://github.com/cedric-chaumont-st-dev/optee_os","homepage":null,"size":3557,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OP-TEE:master","ref":"master","sha":"c974c7ddc7d8b36e4f9798c22d0c38dd9efd5f82","user":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"repo":{"id":20193261,"name":"optee_os","full_name":"OP-TEE/optee_os","owner":{"login":"OP-TEE","id":7488961,"avatar_url":"https://avatars.githubusercontent.com/u/7488961?v=3","gravatar_id":"","url":"https://api.github.com/users/OP-TEE","html_url":"https://github.com/OP-TEE","followers_url":"https://api.github.com/users/OP-TEE/followers","following_url":"https://api.github.com/users/OP-TEE/following{/other_user}","gists_url":"https://api.github.com/users/OP-TEE/gists{/gist_id}","starred_url":"https://api.github.com/users/OP-TEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OP-TEE/subscriptions","organizations_url":"https://api.github.com/users/OP-TEE/orgs","repos_url":"https://api.github.com/users/OP-TEE/repos","events_url":"https://api.github.com/users/OP-TEE/events{/privacy}","received_events_url":"https://api.github.com/users/OP-TEE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OP-TEE/optee_os","description":"Trusted side of the TEE","fork":false,"url":"https://api.github.com/repos/OP-TEE/optee_os","forks_url":"https://api.github.com/repos/OP-TEE/optee_os/forks","keys_url":"https://api.github.com/repos/OP-TEE/optee_os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OP-TEE/optee_os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OP-TEE/optee_os/teams","hooks_url":"https://api.github.com/repos/OP-TEE/optee_os/hooks","issue_events_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/events{/number}","events_url":"https://api.github.com/repos/OP-TEE/optee_os/events","assignees_url":"https://api.github.com/repos/OP-TEE/optee_os/assignees{/user}","branches_url":"https://api.github.com/repos/OP-TEE/optee_os/branches{/branch}","tags_url":"https://api.github.com/repos/OP-TEE/optee_os/tags","blobs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OP-TEE/optee_os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OP-TEE/optee_os/git/refs{/sha}","trees_url":"https://api.github.com/repos/OP-TEE/optee_os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OP-TEE/optee_os/statuses/{sha}","languages_url":"https://api.github.com/repos/OP-TEE/optee_os/languages","stargazers_url":"https://api.github.com/repos/OP-TEE/optee_os/stargazers","contributors_url":"https://api.github.com/repos/OP-TEE/optee_os/contributors","subscribers_url":"https://api.github.com/repos/OP-TEE/optee_os/subscribers","subscription_url":"https://api.github.com/repos/OP-TEE/optee_os/subscription","commits_url":"https://api.github.com/repos/OP-TEE/optee_os/commits{/sha}","git_commits_url":"https://api.github.com/repos/OP-TEE/optee_os/git/commits{/sha}","comments_url":"https://api.github.com/repos/OP-TEE/optee_os/comments{/number}","issue_comment_url":"https://api.github.com/repos/OP-TEE/optee_os/issues/comments{/number}","contents_url":"https://api.github.com/repos/OP-TEE/optee_os/contents/{+path}","compare_url":"https://api.github.com/repos/OP-TEE/optee_os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OP-TEE/optee_os/merges","archive_url":"https://api.github.com/repos/OP-TEE/optee_os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OP-TEE/optee_os/downloads","issues_url":"https://api.github.com/repos/OP-TEE/optee_os/issues{/number}","pulls_url":"https://api.github.com/repos/OP-TEE/optee_os/pulls{/number}","milestones_url":"https://api.github.com/repos/OP-TEE/optee_os/milestones{/number}","notifications_url":"https://api.github.com/repos/OP-TEE/optee_os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OP-TEE/optee_os/labels{/name}","releases_url":"https://api.github.com/repos/OP-TEE/optee_os/releases{/id}","created_at":"2014-05-26T17:18:57Z","updated_at":"2015-05-26T14:32:29Z","pushed_at":"2015-05-29T07:54:13Z","git_url":"git://github.com/OP-TEE/optee_os.git","ssh_url":"git@github.com:OP-TEE/optee_os.git","clone_url":"https://github.com/OP-TEE/optee_os.git","svn_url":"https://github.com/OP-TEE/optee_os","homepage":null,"size":10283,"stargazers_count":50,"watchers_count":50,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":20,"forks":42,"open_issues":20,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287"},"html":{"href":"https://github.com/OP-TEE/optee_os/pull/287"},"issue":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/287"},"comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/issues/287/comments"},"review_comments":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287/comments"},"review_comment":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OP-TEE/optee_os/pulls/287/commits"},"statuses":{"href":"https://api.github.com/repos/OP-TEE/optee_os/statuses/ad0750976ed538f580d84cd303ec88b2636e463f"}}}}