diff options
-rw-r--r-- | drivers/usb/misc/berry_charge.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c index 92c1d2768df9..24e2dc3148a4 100644 --- a/drivers/usb/misc/berry_charge.c +++ b/drivers/usb/misc/berry_charge.c | |||
@@ -71,7 +71,7 @@ static int magic_charge(struct usb_device *udev) | |||
71 | if (retval != 2) { | 71 | if (retval != 2) { |
72 | dev_err(&udev->dev, "First magic command failed: %d.\n", | 72 | dev_err(&udev->dev, "First magic command failed: %d.\n", |
73 | retval); | 73 | retval); |
74 | return retval; | 74 | goto exit; |
75 | } | 75 | } |
76 | 76 | ||
77 | dbg(&udev->dev, "Sending second magic command\n"); | 77 | dbg(&udev->dev, "Sending second magic command\n"); |
@@ -80,7 +80,7 @@ static int magic_charge(struct usb_device *udev) | |||
80 | if (retval != 0) { | 80 | if (retval != 0) { |
81 | dev_err(&udev->dev, "Second magic command failed: %d.\n", | 81 | dev_err(&udev->dev, "Second magic command failed: %d.\n", |
82 | retval); | 82 | retval); |
83 | return retval; | 83 | goto exit; |
84 | } | 84 | } |
85 | 85 | ||
86 | dbg(&udev->dev, "Calling set_configuration\n"); | 86 | dbg(&udev->dev, "Calling set_configuration\n"); |
@@ -88,6 +88,8 @@ static int magic_charge(struct usb_device *udev) | |||
88 | if (retval) | 88 | if (retval) |
89 | dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval); | 89 | dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval); |
90 | 90 | ||
91 | exit: | ||
92 | kfree(dummy_buffer); | ||
91 | return retval; | 93 | return retval; |
92 | } | 94 | } |
93 | 95 | ||
@@ -112,6 +114,7 @@ static int magic_dual_mode(struct usb_device *udev) | |||
112 | if (retval) | 114 | if (retval) |
113 | dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval); | 115 | dev_err(&udev->dev, "Set Configuration failed :%d.\n", retval); |
114 | 116 | ||
117 | kfree(dummy_buffer); | ||
115 | return retval; | 118 | return retval; |
116 | } | 119 | } |
117 | 120 | ||