From: Caleb Connolly Date: Thu, 8 Aug 2024 23:59:32 +0000 (+0200) Subject: soc: qcom: cmd-db: use strncmp() instead of memcmp() X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=75acc51189117b9c42232d0ea5c75cf72e39a4d8;p=u-boot.git 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 Signed-off-by: Caleb Connolly --- diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index 08736ea936..c7c5230983 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)