diff options
author | Xiaomeng Tong <[email protected]> | 2022-03-27 14:08:22 +0800 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2022-03-27 10:32:42 +0200 |
commit | 0112f822f8a6d8039c94e0bc9b264d7ffc5d4704 (patch) | |
tree | 41dfa0c153d03c9fa00e3457887c5b5c53a34a0f /drivers/usb/cdns3/cdns3-ti.c | |
parent | 5a8738571747c1e275a40b69a608657603867b7e (diff) |
ALSA: cs4236: fix an incorrect NULL check on list iterator
The bug is here:
err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);
The list iterator value 'cdev' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.
To fix the bug, use a new variable 'iter' as the list iterator,
while use the original variable 'cdev' as a dedicated pointer
to point to the found element. And snd_card_cs423x_pnp() itself
has NULL check for cdev.
Cc: [email protected]
Fixes: c2b73d1458014 ("ALSA: cs4236: cs4232 and cs4236 driver merge to solve PnP BIOS detection")
Signed-off-by: Xiaomeng Tong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ti.c')
0 files changed, 0 insertions, 0 deletions