Commit 530b5af
spi: fsl-dspi: fix use-after-free in remove path
spi_unregister_controller() not only unregisters the controller, but
also frees the controller. This will free the driver data with it, so
we must not access it later dspi_remove().
Solve this by allocating the driver data separately from the SPI
controller.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20200923131026.20707-1-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent b867eef commit 530b5af
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | | - | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1277 | 1281 | | |
1278 | 1282 | | |
1279 | 1283 | | |
1280 | | - | |
1281 | 1284 | | |
1282 | 1285 | | |
1283 | 1286 | | |
| |||
1414 | 1417 | | |
1415 | 1418 | | |
1416 | 1419 | | |
1417 | | - | |
| 1420 | + | |
1418 | 1421 | | |
1419 | 1422 | | |
1420 | 1423 | | |
| |||
1437 | 1440 | | |
1438 | 1441 | | |
1439 | 1442 | | |
1440 | | - | |
1441 | | - | |
| 1443 | + | |
1442 | 1444 | | |
1443 | 1445 | | |
1444 | 1446 | | |
| |||
0 commit comments