USB: serial: fix memleak in driver-registration error path
udriver struct allocated by kzalloc() will not be freed if usb_register() and next calls fail. This patch fixes this by adding one more step with kfree(udriver) in error path. Signed-off-by: NAlexey Klimov <klimov.linux@gmail.com> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Cc: stable <stable@vger.kernel.org> Signed-off-by: NJohan Hovold <johan@kernel.org>
Showing
想要评论请 注册 或 登录