Commit 915e34d
s390/ism: add release function for struct device
According to device_release() in /drivers/base/core.c,
a device without a release function is a broken device
and must be fixed.
The current code directly frees the device after calling device_add()
without waiting for other kernel parts to release their references.
Thus, a reference could still be held to a struct device,
e.g., by sysfs, leading to potential use-after-free
issues if a proper release function is not set.
Fixes: 8c81ba2 ("net/smc: De-tangle ism and smc device initialization")
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: Julian Ruess <julianr@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250214120137.563409-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 07b598c commit 915e34d
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
591 | 600 | | |
592 | 601 | | |
593 | 602 | | |
| |||
601 | 610 | | |
602 | 611 | | |
603 | 612 | | |
| 613 | + | |
604 | 614 | | |
605 | 615 | | |
606 | 616 | | |
| |||
637 | 647 | | |
638 | 648 | | |
639 | 649 | | |
640 | | - | |
| 650 | + | |
641 | 651 | | |
642 | 652 | | |
643 | 653 | | |
| |||
682 | 692 | | |
683 | 693 | | |
684 | 694 | | |
685 | | - | |
| 695 | + | |
686 | 696 | | |
687 | 697 | | |
688 | 698 | | |
| |||
0 commit comments