Skip to content

Commit

Permalink
control: Make ump_{endpoint|block}_info calls optional
Browse files Browse the repository at this point in the history
Add the NULL check for ump_endpoint_info and ump_block_info calls.
Those can be NULl depending on the target.

Fixes: 81b0cf4 ("control: Add UMP Endpoint and Block info query support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
tiwai committed Aug 15, 2024
1 parent 769d1db commit fa673b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/control/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,10 @@ int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device)
int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
{
assert(ctl && info);
return ctl->ops->ump_endpoint_info(ctl, info);
fprintf(stderr, "%s:%d\n", __func__, __LINE__);
if (ctl->ops->ump_endpoint_info)
return ctl->ops->ump_endpoint_info(ctl, info);
return -ENXIO;
}

/**
Expand All @@ -1305,7 +1308,9 @@ int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info)
{
assert(ctl && info);
return ctl->ops->ump_block_info(ctl, info);
if (ctl->ops->ump_block_info)
return ctl->ops->ump_block_info(ctl, info);
return -ENXIO;
}

/**
Expand Down

0 comments on commit fa673b7

Please sign in to comment.