Commit 61f0aa4
PCI: xilinx-nwl: Simplify code and fix a memory leak
Allocate space for bitmap in struct nwl_msi at probe time instead of
dynamically allocating the memory at runtime.
This simplifies code (especially error handling paths) and avoid some
open-coded arithmetic in allocator arguments.
This also fixes a potential memory leak. The bitmap was never freed. It
is now part of a managed resource.
Link: https://lore.kernel.org/r/5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Reviewed-by: Krzysztof Wilczyński <[email protected]>1 parent fa55b7d commit 61f0aa4
1 file changed
+7
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
344 | 342 | | |
345 | 343 | | |
346 | 344 | | |
| |||
560 | 558 | | |
561 | 559 | | |
562 | 560 | | |
563 | | - | |
564 | 561 | | |
565 | 562 | | |
566 | 563 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | 564 | | |
572 | 565 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 566 | + | |
| 567 | + | |
577 | 568 | | |
578 | 569 | | |
579 | 570 | | |
580 | 571 | | |
581 | 572 | | |
582 | 573 | | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
| 574 | + | |
| 575 | + | |
587 | 576 | | |
588 | 577 | | |
589 | 578 | | |
| |||
592 | 581 | | |
593 | 582 | | |
594 | 583 | | |
595 | | - | |
596 | | - | |
| 584 | + | |
597 | 585 | | |
598 | 586 | | |
599 | 587 | | |
| |||
632 | 620 | | |
633 | 621 | | |
634 | 622 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | 623 | | |
640 | 624 | | |
641 | 625 | | |
| |||
0 commit comments