diff options
| author | Ivan Khoronzhuk <[email protected]> | 2023-01-27 22:02:14 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-02-17 10:51:28 -0500 |
| commit | 3106e475243e1e35df18d5086f7a5df8758bbda1 (patch) | |
| tree | 94338bc92230241c8415fe69fcd33ea3dcb40dcb /common | |
| parent | aa0a8a0be2401abbe26f4e5294a24216399c8291 (diff) | |
common: avb_verify: prevent opening incorrect session
The arg->session is not valid if arg->ret != NULL, so can't be
assigned, correct this.
Signed-off-by: Ivan Khoronzhuk <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
Diffstat (limited to 'common')
| -rw-r--r-- | common/avb_verify.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/avb_verify.c b/common/avb_verify.c index 0520a714556..48ba8db51e5 100644 --- a/common/avb_verify.c +++ b/common/avb_verify.c @@ -619,10 +619,11 @@ static int get_open_session(struct AvbOpsData *ops_data) memset(&arg, 0, sizeof(arg)); tee_optee_ta_uuid_to_octets(arg.uuid, &uuid); rc = tee_open_session(tee, &arg, 0, NULL); - if (!rc) { - ops_data->tee = tee; - ops_data->session = arg.session; - } + if (rc || arg.ret) + continue; + + ops_data->tee = tee; + ops_data->session = arg.session; } return 0; |
