Merge tag 'arm-dt-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / drivers / soc / qcom / cmd-db.c
index dd87201..629a718 100644 (file)
@@ -141,13 +141,17 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
        const struct rsc_hdr *rsc_hdr;
        const struct entry_header *ent;
        int ret, i, j;
-       u8 query[8];
+       u8 query[sizeof(ent->id)] __nonstring;
 
        ret = cmd_db_ready();
        if (ret)
                return ret;
 
-       /* Pad out query string to same length as in DB */
+       /*
+        * Pad out query string to same length as in DB. NOTE: the output
+        * query string is not necessarily '\0' terminated if it bumps up
+        * against the max size. That's OK and expected.
+        */
        strncpy(query, id, sizeof(query));
 
        for (i = 0; i < MAX_SLV_ID; i++) {