summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/apple-mfi-fastcharge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/apple-mfi-fastcharge.c')
-rw-r--r--drivers/usb/misc/apple-mfi-fastcharge.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
index 6dedd5498e8a..ac8695195c13 100644
--- a/drivers/usb/misc/apple-mfi-fastcharge.c
+++ b/drivers/usb/misc/apple-mfi-fastcharge.c
@@ -178,6 +178,7 @@ static int mfi_fc_probe(struct usb_device *udev)
{
struct power_supply_config battery_cfg = {};
struct mfi_device *mfi = NULL;
+ int err;
if (!mfi_fc_match(udev))
return -ENODEV;
@@ -194,8 +195,9 @@ static int mfi_fc_probe(struct usb_device *udev)
&battery_cfg);
if (IS_ERR(mfi->battery)) {
dev_err(&udev->dev, "Can't register battery\n");
+ err = PTR_ERR(mfi->battery);
kfree(mfi);
- return PTR_ERR(mfi->battery);
+ return err;
}
mfi->udev = usb_get_dev(udev);