mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
topology: tplg_elem_lookup() checks parameter before searching
Check the parameters at first in case of misuse. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4136d98606
commit
d170e1ffa1
1 changed files with 3 additions and 0 deletions
|
|
@ -111,6 +111,9 @@ struct tplg_elem *tplg_elem_lookup(struct list_head *base, const char* id,
|
|||
struct list_head *pos;
|
||||
struct tplg_elem *elem;
|
||||
|
||||
if (!base || !id)
|
||||
return NULL;
|
||||
|
||||
list_for_each(pos, base) {
|
||||
|
||||
elem = list_entry(pos, struct tplg_elem, list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue