aboutsummaryrefslogtreecommitdiff
path: root/lib/string_helpers.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-05-31 08:04:47 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-05 11:16:03 -0700
commit76faf97bf04fb05924c9da5e9b243404eaee9946 (patch)
treec9f2e61fba43e6ee558e1d317c65eb6ba7ed7f36 /lib/string_helpers.c
parent18ba8e2c21b721d1c36e65525a30b25804e9b33e (diff)
USB: cdc-acm: fix resource reclaim in error path of acm_probe
commit c2572b78aa0447244a38e555ebb1b3b48a0088a5 upstream. This patch fixes resource reclaim in error path of acm_probe: 1. In the case of "out of memory (read urbs usb_alloc_urb)\n")", there is no need to call acm_read_buffers_free(acm) here. Fix it by goto alloc_fail6 instead of alloc_fail7. 2. In the case of "out of memory (write urbs usb_alloc_urb)", usb_alloc_urb may fail in any iteration of the for loop. Current implementation does not properly free allocated snd->urb. Fix it by goto alloc_fail8 instead of alloc_fail7. 3. In the case of device_create_file(&intf->dev,&dev_attr_iCountryCodeRelDate) fail, acm->country_codes is kfreed. As a result, device_remove_file for dev_attr_wCountryCodes will not be executed in acm_disconnect. Fix it by calling device_remove_file for dev_attr_wCountryCodes before goto skip_countries. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions