]> git.itanic.dy.fi Git - linux-stable/commit
HID: hid-steam: Fix cleanup in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 12 Jan 2024 14:35:06 +0000 (17:35 +0300)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 15 Jan 2024 10:54:24 +0000 (11:54 +0100)
commita9f1da09c69f13ef471db8b22107a28042d230ca
tree3291be8ee5c44c3a2228a3438a8abd41f11f12d7
parenta9668169961106f3598384fe95004106ec191201
HID: hid-steam: Fix cleanup in probe()

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: 691ead124a0c ("HID: hid-steam: Clean up locking")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Vicki Pfau <vi@endrift.com>
Link: https://lore.kernel.org/r/1fd87904-dabf-4879-bb89-72d13ebfc91e@moroto.mountain
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-steam.c