lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
[platform/kernel/linux-starfive.git] / lib / cpu_rmap.c
index e77f12b..1833ad7 100644 (file)
@@ -268,8 +268,8 @@ static void irq_cpu_rmap_release(struct kref *ref)
        struct irq_glue *glue =
                container_of(ref, struct irq_glue, notify.kref);
 
-       cpu_rmap_put(glue->rmap);
        glue->rmap->obj[glue->index] = NULL;
+       cpu_rmap_put(glue->rmap);
        kfree(glue);
 }