u64                     flags;
        bool                    has_rss;
        unsigned int            ppi_nr;
-       struct partition_desc   *ppi_descs[16];
+       struct partition_desc   **ppi_descs;
 };
 
 static struct gic_chip_data gic_data __read_mostly;
         * then we need to match the partition domain.
         */
        if (fwspec->param_count >= 4 &&
-           fwspec->param[0] == 1 && fwspec->param[3] != 0)
+           fwspec->param[0] == 1 && fwspec->param[3] != 0 &&
+           gic_data.ppi_descs)
                return d == partition_get_domain(gic_data.ppi_descs[fwspec->param[1]]);
 
        return d == gic_data.domain;
        struct device_node *np;
        int ret;
 
+       if (!gic_data.ppi_descs)
+               return -ENOMEM;
+
        np = of_find_node_by_phandle(fwspec->param[3]);
        if (WARN_ON(!np))
                return -EINVAL;
        if (!parts_node)
                return;
 
+       gic_data.ppi_descs = kcalloc(gic_data.ppi_nr, sizeof(*gic_data.ppi_descs), GFP_KERNEL);
+       if (!gic_data.ppi_descs)
+               return;
+
        nr_parts = of_get_child_count(parts_node);
 
        if (!nr_parts)
                part_idx++;
        }
 
-       for (i = 0; i < 16; i++) {
+       for (i = 0; i < gic_data.ppi_nr; i++) {
                unsigned int irq;
                struct partition_desc *desc;
                struct irq_fwspec ppi_fwspec = {