summaryrefslogtreecommitdiff
path: root/sound/usb/usx2y/usbusx2y.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-05-17 15:15:40 +0200
committerTakashi Iwai <tiwai@suse.de>2021-05-17 16:04:40 +0200
commit02d382af1c4e321acbea1c25b97ee13f52b9ac7d (patch)
treefb3cca599b57c244879a96cdf4166bbe77424dbf /sound/usb/usx2y/usbusx2y.h
parenta11aa8537e13dd1082c85b102b98afc2a156a815 (diff)
ALSA: usx2y: Fix potential memory leaks
Theoretically the initialization functions in usx2y drivers may be called multiple times as the driver gets initialized via hwpdep ioctl. Meanwhile, those functions including memory allocations don't check whether they are called twice, and they forget the old resources, which would lead to memory leaks. This patch adds the sanity checks about the doubly initializations to give kernel WARNING, and returns an error in such a case. Also, each allocation assures to release the resources at its error path properly. Link: https://lore.kernel.org/r/20210517131545.27252-7-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usbusx2y.h')
0 files changed, 0 insertions, 0 deletions