Skip to content
Commit b9e00088 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Greg Kroah-Hartman
Browse files

USB: gadget: f_mass_storage: fix in error recovery



In to places in fsg_common_init() an unconditional call to kfree()
on common was performed in error recovery which is not a valid
behaviour since fsg_common structure is not always allocated by
fsg_common_init().

To fix, the calls has been replaced with a goto to a proper error
recovery which does the correct thing.

Also, refactored fsg_common_release() function.

Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Reviewed-by: default avatarViral Mehta <viral.mehta@lntinfotech.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f537da68
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment