.. | .. |
---|
232 | 232 | |
---|
233 | 233 | for (index = 0; index < rmap->used; index++) { |
---|
234 | 234 | 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); |
---|
236 | 237 | } |
---|
237 | 238 | |
---|
238 | 239 | cpu_rmap_put(rmap); |
---|
.. | .. |
---|
267 | 268 | struct irq_glue *glue = |
---|
268 | 269 | container_of(ref, struct irq_glue, notify.kref); |
---|
269 | 270 | |
---|
| 271 | + glue->rmap->obj[glue->index] = NULL; |
---|
270 | 272 | cpu_rmap_put(glue->rmap); |
---|
271 | 273 | kfree(glue); |
---|
272 | 274 | } |
---|
.. | .. |
---|
297 | 299 | rc = irq_set_affinity_notifier(irq, &glue->notify); |
---|
298 | 300 | if (rc) { |
---|
299 | 301 | cpu_rmap_put(glue->rmap); |
---|
| 302 | + rmap->obj[glue->index] = NULL; |
---|
300 | 303 | kfree(glue); |
---|
301 | 304 | } |
---|
302 | 305 | return rc; |
---|