-
Notifications
You must be signed in to change notification settings - Fork 846
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: adc: cf_axi_adc_core: fix segfault on unbind
If the converter driver is removed before us (note that can only happen if someone does the unbind through sysfs), we will access a NULL pointer when calling module_put(). To fix that, let's just save the module owner field so that we can unconditionally call module_put(). In order to do that, we now dynamically allocate 'struct axiadc_spidev' object (which now holds a pointer to the owner field) so that we can pass it to devm_add_action_or_reset(). Signed-off-by: Nuno Sa <[email protected]>
- Loading branch information
Showing
1 changed file
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters