Skip to content

Commit 0ee2981

Browse files
Roderick Colenbranderbentiss
authored andcommitted
HID: playstation: fix free of uninialized pointer for DS4 in Bluetooth.
The 'buf' variable is only used in the USB (if-path) and not in the Bluetooth else-path. Since it is not set to NULL. this results in freeing an uninitialized pointer. Since the else code-path doesn't need buf, just return 0. Fixes: 2d77474 ("HID: playstation: add DualShock4 bluetooth support.") Signed-off-by: Roderick Colenbrander <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 67c90d1 commit 0ee2981

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ config HID_PLAYSTATION
897897
select CRC32
898898
select POWER_SUPPLY
899899
help
900-
Provides support for Sony PS5 controllers including support for
900+
Provides support for Sony PS4/PS5 controllers including support for
901901
its special functionalities e.g. touchpad, lights and motion
902902
sensors.
903903

drivers/hid/hid-playstation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ static int dualshock4_get_mac_address(struct dualshock4 *ds4)
19161916
if (ret != sizeof(ds4->base.mac_address))
19171917
return -EINVAL;
19181918

1919-
ret = 0;
1919+
return 0;
19201920
}
19211921

19221922
err_free:

0 commit comments

Comments
 (0)