OSDN Git Service

ALSA: usb-audio: fix memory leak on cval
authorColin Ian King <colin.king@canonical.com>
Tue, 27 Mar 2018 14:30:01 +0000 (15:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 27 Mar 2018 15:45:33 +0000 (17:45 +0200)
commit623760257b39632ffc5051fc88167b546dcfa791
tree3e4955b7b0da1e0b323b3c55e36ebe8af9a47bc7
parentf6d297df4dd47ef949540e4a201230d0c5308325
ALSA: usb-audio: fix memory leak on cval

With the current exit return path of the ctl_info allocation failure
cval is not being freed resulting in a memory leak. Fix this by kfree'ing
it on the return.

Detected by CoverityScan, CID#1466878 ("Resource Leak")

Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control query argument")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c