提交 fdf99c9e 编写于 作者: G Greg Kroah-Hartman

USB: fix memory leak in berry_charge driver

This fixes a small memory leak that happens every time the device is
plugged in.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 12943f09
......@@ -71,7 +71,7 @@ static int magic_charge(struct usb_device *udev)
if (retval != 2) {
dev_err(&udev->dev, "First magic command failed: %d.\n",
retval);
return retval;
goto exit;
}
dbg(&udev->dev, "Sending second magic command\n");
......@@ -80,7 +80,7 @@ static int magic_charge(struct usb_device *udev)
if (retval != 0) {
dev_err(&udev->dev, "Second magic command failed: %d.\n",
retval);
return retval;
goto exit;
}
dbg(&udev->dev, "Calling set_configuration\n");
......@@ -88,6 +88,8 @@ static int magic_charge(struct usb_device *udev)
if (retval)
dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
exit:
kfree(dummy_buffer);
return retval;
}
......@@ -112,6 +114,7 @@ static int magic_dual_mode(struct usb_device *udev)
if (retval)
dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval);
kfree(dummy_buffer);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册