hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/lib/cpu_rmap.c
....@@ -232,7 +232,8 @@
232232
233233 for (index = 0; index < rmap->used; index++) {
234234 glue = rmap->obj[index];
235
- irq_set_affinity_notifier(glue->notify.irq, NULL);
235
+ if (glue)
236
+ irq_set_affinity_notifier(glue->notify.irq, NULL);
236237 }
237238
238239 cpu_rmap_put(rmap);
....@@ -267,6 +268,7 @@
267268 struct irq_glue *glue =
268269 container_of(ref, struct irq_glue, notify.kref);
269270
271
+ glue->rmap->obj[glue->index] = NULL;
270272 cpu_rmap_put(glue->rmap);
271273 kfree(glue);
272274 }
....@@ -297,6 +299,7 @@
297299 rc = irq_set_affinity_notifier(irq, &glue->notify);
298300 if (rc) {
299301 cpu_rmap_put(glue->rmap);
302
+ rmap->obj[glue->index] = NULL;
300303 kfree(glue);
301304 }
302305 return rc;