aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index e23d1d18f9d6..3447549fcc93 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -875,6 +875,7 @@ static int its_alloc_tables(const char *node_name, struct its_node *its)
875 } 875 }
876 876
877 alloc_size = (1 << order) * PAGE_SIZE; 877 alloc_size = (1 << order) * PAGE_SIZE;
878retry_alloc_baser:
878 alloc_pages = (alloc_size / psz); 879 alloc_pages = (alloc_size / psz);
879 if (alloc_pages > GITS_BASER_PAGES_MAX) { 880 if (alloc_pages > GITS_BASER_PAGES_MAX) {
880 alloc_pages = GITS_BASER_PAGES_MAX; 881 alloc_pages = GITS_BASER_PAGES_MAX;
@@ -938,13 +939,16 @@ retry_baser:
938 * size and retry. If we reach 4K, then 939 * size and retry. If we reach 4K, then
939 * something is horribly wrong... 940 * something is horribly wrong...
940 */ 941 */
942 free_pages((unsigned long)base, order);
943 its->tables[i] = NULL;
944
941 switch (psz) { 945 switch (psz) {
942 case SZ_16K: 946 case SZ_16K:
943 psz = SZ_4K; 947 psz = SZ_4K;
944 goto retry_baser; 948 goto retry_alloc_baser;
945 case SZ_64K: 949 case SZ_64K:
946 psz = SZ_16K; 950 psz = SZ_16K;
947 goto retry_baser; 951 goto retry_alloc_baser;
948 } 952 }
949 } 953 }
950 954