Skip to content

Commit

Permalink
Input: ims-pcu - fix a memory leak on error
Browse files Browse the repository at this point in the history
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dmitry Torokhov committed Apr 2, 2013
1 parent 3903078 commit 3c2b901
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/misc/ims-pcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 3c2b901

Please sign in to comment.