diff options
| author | Caleb Connolly <[email protected]> | 2024-08-09 01:59:32 +0200 |
|---|---|---|
| committer | Caleb Connolly <[email protected]> | 2024-09-06 10:47:46 +0200 |
| commit | 75acc51189117b9c42232d0ea5c75cf72e39a4d8 (patch) | |
| tree | 2933011b23b3345a6079d4371b8db2b342c255fb | |
| parent | 9f2d4561465b42f8cdc478ea5df44b93e12a90d9 (diff) | |
soc: qcom: cmd-db: use strncmp() instead of memcmp()
memcmp() can cause aborts on some platforms and generally seems to be
the wrong approach here. Use strncmp() instead which is more correct.
Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Caleb Connolly <[email protected]>
| -rw-r--r-- | drivers/soc/qcom/cmd-db.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index 08736ea936a..c7c5230983d 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -141,7 +141,7 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh, ent = rsc_to_entry_header(rsc_hdr); for (j = 0; j < le16_to_cpu(rsc_hdr->cnt); j++, ent++) { - if (memcmp(ent->id, query, sizeof(ent->id)) == 0) { + if (strncmp(ent->id, query, sizeof(ent->id)) == 0) { if (eh) *eh = ent; if (rh) |
