#include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/delay.h>
+#include <linux/minmax.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/seq_file.h>
        const struct wmfw_region *region;
        const struct cs_dsp_region *mem;
        const char *region_name;
-       char *text = NULL;
        struct cs_dsp_buf *buf;
        unsigned int reg;
        int regions = 0;
 
                region_name = "Unknown";
                reg = 0;
-               text = NULL;
                offset = le32_to_cpu(region->offset) & 0xffffff;
                type = be32_to_cpu(region->type) & 0xff;
 
                switch (type) {
+               case WMFW_INFO_TEXT:
                case WMFW_NAME_TEXT:
-                       region_name = "Firmware name";
-                       text = kzalloc(le32_to_cpu(region->len) + 1,
-                                      GFP_KERNEL);
+                       region_name = "Info/Name";
+                       cs_dsp_info(dsp, "%s: %.*s\n", file,
+                                   min(le32_to_cpu(region->len), 100), region->data);
                        break;
                case WMFW_ALGORITHM_DATA:
                        region_name = "Algorithm";
                        if (ret != 0)
                                goto out_fw;
                        break;
-               case WMFW_INFO_TEXT:
-                       region_name = "Information";
-                       text = kzalloc(le32_to_cpu(region->len) + 1,
-                                      GFP_KERNEL);
-                       break;
                case WMFW_ABSOLUTE:
                        region_name = "Absolute";
                        reg = offset;
                           regions, le32_to_cpu(region->len), offset,
                           region_name);
 
-               if (text) {
-                       memcpy(text, region->data, le32_to_cpu(region->len));
-                       cs_dsp_info(dsp, "%s: %s\n", file, text);
-                       kfree(text);
-                       text = NULL;
-               }
-
                if (reg) {
                        buf = cs_dsp_buf_alloc(region->data,
                                               le32_to_cpu(region->len),
 out_fw:
        regmap_async_complete(regmap);
        cs_dsp_buf_free(&buf_list);
-       kfree(text);
 
        if (ret == -EOVERFLOW)
                cs_dsp_err(dsp, "%s: file content overflows file data\n", file);
        struct cs_dsp_alg_region *alg_region;
        const char *region_name;
        int ret, pos, blocks, type, offset, reg, version;
-       char *text = NULL;
        struct cs_dsp_buf *buf;
 
        if (!firmware)
                region_name = "Unknown";
                switch (type) {
                case (WMFW_NAME_TEXT << 8):
-                       text = kzalloc(le32_to_cpu(blk->len) + 1, GFP_KERNEL);
+                       cs_dsp_info(dsp, "%s: %.*s\n", dsp->fw_name,
+                                   min(le32_to_cpu(blk->len), 100), blk->data);
                        break;
                case (WMFW_INFO_TEXT << 8):
                case (WMFW_METADATA << 8):
                        break;
                }
 
-               if (text) {
-                       memcpy(text, blk->data, le32_to_cpu(blk->len));
-                       cs_dsp_info(dsp, "%s: %s\n", dsp->fw_name, text);
-                       kfree(text);
-                       text = NULL;
-               }
-
                if (reg) {
                        buf = cs_dsp_buf_alloc(blk->data,
                                               le32_to_cpu(blk->len),
 out_fw:
        regmap_async_complete(regmap);
        cs_dsp_buf_free(&buf_list);
-       kfree(text);
 
        if (ret == -EOVERFLOW)
                cs_dsp_err(dsp, "%s: file content overflows file data\n", file);