diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-04-01 04:09:15 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-04-02 01:23:30 -0400 |
commit | 3c2b901003b4c152e19e6578c1705ce2c90edd4a (patch) | |
tree | 79f5ee1ed90731df307d7df9a286dbf3d0cd02b8 | |
parent | 3903078677a8dc6f056970b67d15840aa51e1dfa (diff) |
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>
-rw-r--r-- | drivers/input/misc/ims-pcu.c | 5 |
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) | |||
292 | if (!gamepad || !input) { | 292 | if (!gamepad || !input) { |
293 | dev_err(pcu->dev, | 293 | dev_err(pcu->dev, |
294 | "Not enough memory for gamepad device\n"); | 294 | "Not enough memory for gamepad device\n"); |
295 | return -ENOMEM; | 295 | error = -ENOMEM; |
296 | goto err_free_mem; | ||
296 | } | 297 | } |
297 | 298 | ||
298 | gamepad->input = input; | 299 | gamepad->input = input; |
@@ -1156,7 +1157,7 @@ static ssize_t ims_pcu_update_firmware_store(struct device *dev, | |||
1156 | { | 1157 | { |
1157 | struct usb_interface *intf = to_usb_interface(dev); | 1158 | struct usb_interface *intf = to_usb_interface(dev); |
1158 | struct ims_pcu *pcu = usb_get_intfdata(intf); | 1159 | struct ims_pcu *pcu = usb_get_intfdata(intf); |
1159 | const struct firmware *fw; | 1160 | const struct firmware *fw = NULL; |
1160 | int value; | 1161 | int value; |
1161 | int error; | 1162 | int error; |
1162 | 1163 | ||