Commit b3b9596
Bartosz Golaszewski
gpio: cdev: check for NULL labels when sanitizing them for irqs
We need to take into account that a line's consumer label may be NULL
and not try to kstrdup() it in that case but rather pass the NULL
pointer up the stack to the interrupt request function.
To that end: let make_irq_label() return NULL as a valid return value
and use ERR_PTR() instead to signal an allocation failure to callers.
Cc: stable@vger.kernel.org
Fixes: b344908 ("gpio: cdev: sanitize the label before requesting the interrupt")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/lkml/20240402093534.212283-1-naresh.kamboju@linaro.org/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tested-by: Anders Roxell <anders.roxell@linaro.org>1 parent e8acd2d commit b3b9596
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
1088 | | - | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1089 | 1098 | | |
1090 | 1099 | | |
1091 | 1100 | | |
| |||
1158 | 1167 | | |
1159 | 1168 | | |
1160 | 1169 | | |
1161 | | - | |
1162 | | - | |
| 1170 | + | |
| 1171 | + | |
1163 | 1172 | | |
1164 | 1173 | | |
1165 | 1174 | | |
| |||
2217 | 2226 | | |
2218 | 2227 | | |
2219 | 2228 | | |
2220 | | - | |
2221 | | - | |
| 2229 | + | |
| 2230 | + | |
2222 | 2231 | | |
2223 | 2232 | | |
2224 | 2233 | | |
| |||
0 commit comments