usb: oxu210hp-hcd: Fix memory leak in oxu_create
commita072896a07120698c24f6239569e31dfeae8d24b
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 23 Nov 2020 14:58:09 +0000 (23 22:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:44:59 +0000 (29 13:44 +0100)
tree4a4d3f92e96a0560f9e62dceb157f23f365bf821
parent4659119bb99282a40b58746c9ccae7001993f126
usb: oxu210hp-hcd: Fix memory leak in oxu_create

[ Upstream commit e5548b05631ec3e6bfdaef1cad28c799545b791b ]

usb_create_hcd will alloc memory for hcd, and we should
call usb_put_hcd to free it when adding fails to prevent
memory leak.

Fixes: b92a78e582b1a ("usb host: Oxford OXU210HP HCD driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201123145809.1456541-1-zhangqilong3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/oxu210hp-hcd.c