Commit 9f82ed6e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

HID: hid-steam: Fix cleanup in probe()



[ Upstream commit a9f1da09 ]

There are a number of issues in this code.  First of all if
steam_create_client_hid() fails then it leads to an error pointer
dereference when we call hid_destroy_device(steam->client_hdev).

Also there are a number of leaks.  hid_hw_stop() is not called if
hid_hw_open() fails for example.  And it doesn't call steam_unregister()
or hid_hw_close().

Fixes: 691ead12 ("HID: hid-steam: Clean up locking")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarVicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/1fd87904-dabf-4879-bb89-72d13ebfc91e@moroto.mountain


Signed-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
Stable-dep-of: 79504249 ("HID: hid-steam: Move hidraw input (un)registering to work")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0c38fefe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment