Commit 5dca69e
software node: Handle software node injection to an existing device properly
The function software_node_notify() - the function that creates
and removes the symlinks between the node and the device - was
called unconditionally in device_add_software_node() and
device_remove_software_node(), but it needs to be called in
those functions only in the special case where the node is
added to a device that has already been registered.
This fixes NULL pointer dereference that happens if
device_remove_software_node() is used with device that was
never registered.
Fixes: b622b24 ("software node: Allow node addition to already existing device")
Reported-and-tested-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>1 parent 13311e7 commit 5dca69e
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1049 | 1057 | | |
1050 | 1058 | | |
1051 | 1059 | | |
| |||
1065 | 1073 | | |
1066 | 1074 | | |
1067 | 1075 | | |
1068 | | - | |
| 1076 | + | |
| 1077 | + | |
1069 | 1078 | | |
1070 | 1079 | | |
1071 | 1080 | | |
| |||
1119 | 1128 | | |
1120 | 1129 | | |
1121 | 1130 | | |
1122 | | - | |
1123 | | - | |
| 1131 | + | |
1124 | 1132 | | |
1125 | 1133 | | |
1126 | 1134 | | |
| |||
0 commit comments