-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
context: Don't create channels mask when IIO device has 0 channels
When a IIO device has 0 channels, there's no point in creating a channels mask. This fixes an undefined behaviour, as the call to iio_create_channels_mask() could result in calling malloc(0). To prevent this from happening again, iio_create_channels_mask() will now check the validity of its parameter. Signed-off-by: Paul Cercueil <[email protected]>
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 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
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