Johan Hovold <johan@kernel.org> says: Make sure to call controller cleanup() if spi_setup() fails while registering a device to avoid leaking any resources allocated by setup().
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -701,7 +701,7 @@ struct spi_controller { · 700 unmodified lines | ||
| 701 | 701 | int (*transfer)(struct spi_device *spi, |
| 702 | 702 | struct spi_message *mesg); |
| 703 | 703 | |
| 704 | − /* Called on release() to free memory provided by spi_controller */ | |
| 704 | + /* Called on deregistration to free memory provided by spi_controller */ | |
| 705 | 705 | void (*cleanup)(struct spi_device *spi); |
| 706 | 706 | |
| 707 | 707 | /* |