Skip to content
Commit 79f08904 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Greg Kroah-Hartman
Browse files

Input: Fix memory leak in psxpad_spi_probe

In the implementation of psxpad_spi_probe() the allocated memory for
pdev is leaked if psxpad_spi_init_ff() or input_register_polled_device()
fail. The solution is using device managed allocation, like the one used
for pad. Perform the allocation using
devm_input_allocate_polled_device().

Fixes: 8be193c7

 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c193ed6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment