qseecom: change the number of bytes to compare app names
keymaster app has two names with different length: "keymaster" and "keymaste". To compare the app names correctly, the shorter name length is choosen for memcmp in __qseecom_send_cmd. Change-Id: I5f0dff7f9756362be40cc64985b65bc2268d734f Signed-off-by: Zhen Kong <zkong@codeaurora.org> Signed-off-by: William Clark <wclark@codeaurora.org>
This commit is contained in:
parent
17ee33e761
commit
d2b00662c5
|
@ -1156,6 +1156,7 @@ static int __qseecom_send_cmd(struct qseecom_dev_handle *data,
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct qseecom_registered_app_list *ptr_app;
|
struct qseecom_registered_app_list *ptr_app;
|
||||||
bool found_app = false;
|
bool found_app = false;
|
||||||
|
int name_len = 0;
|
||||||
|
|
||||||
reqd_len_sb_in = req->cmd_req_len + req->resp_len;
|
reqd_len_sb_in = req->cmd_req_len + req->resp_len;
|
||||||
|
|
||||||
|
@ -1163,10 +1164,11 @@ static int __qseecom_send_cmd(struct qseecom_dev_handle *data,
|
||||||
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
|
spin_lock_irqsave(&qseecom.registered_app_list_lock, flags);
|
||||||
list_for_each_entry(ptr_app, &qseecom.registered_app_list_head,
|
list_for_each_entry(ptr_app, &qseecom.registered_app_list_head,
|
||||||
list) {
|
list) {
|
||||||
|
name_len = min(strlen(data->client.app_name),
|
||||||
|
strlen(ptr_app->app_name));
|
||||||
if ((ptr_app->app_id == data->client.app_id) &&
|
if ((ptr_app->app_id == data->client.app_id) &&
|
||||||
(!memcmp((void *)ptr_app->app_name,
|
(!memcmp((void *)ptr_app->app_name,
|
||||||
(void *)data->client.app_name,
|
(void *)data->client.app_name, name_len))) {
|
||||||
strlen(data->client.app_name)))) {
|
|
||||||
found_app = true;
|
found_app = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue