summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-04-01 10:09:15 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-04-02 07:23:30 +0200
commit3c2b901003b4c152e19e6578c1705ce2c90edd4a (patch)
tree79f5ee1ed90731df307d7df9a286dbf3d0cd02b8 /drivers/input
parentInput: sysrq - supplement reset sequence with timeout functionality (diff)
downloadlinux-3c2b901003b4c152e19e6578c1705ce2c90edd4a.tar.xz
linux-3c2b901003b4c152e19e6578c1705ce2c90edd4a.zip
Input: ims-pcu - fix a memory leak on error
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/ims-pcu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
index 1b044b99da66..e204f26b0011 100644
--- a/drivers/input/misc/ims-pcu.c
+++ b/drivers/input/misc/ims-pcu.c
@@ -292,7 +292,8 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu)
if (!gamepad || !input) {
dev_err(pcu->dev,
"Not enough memory for gamepad device\n");
- return -ENOMEM;
+ error = -ENOMEM;
+ goto err_free_mem;
}
gamepad->input = input;
@@ -1156,7 +1157,7 @@ static ssize_t ims_pcu_update_firmware_store(struct device *dev,
{
struct usb_interface *intf = to_usb_interface(dev);
struct ims_pcu *pcu = usb_get_intfdata(intf);
- const struct firmware *fw;
+ const struct firmware *fw = NULL;
int value;
int error;