diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ep93xx.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index 551332e4ed0..9da02d108b7 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c | |||
@@ -128,12 +128,16 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) | |||
128 | return -ENOMEM; | 128 | return -ENOMEM; |
129 | 129 | ||
130 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 130 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
131 | if (res == NULL) | 131 | if (res == NULL) { |
132 | return -ENXIO; | 132 | err = -ENXIO; |
133 | goto fail_free; | ||
134 | } | ||
133 | 135 | ||
134 | res = request_mem_region(res->start, resource_size(res), pdev->name); | 136 | res = request_mem_region(res->start, resource_size(res), pdev->name); |
135 | if (res == NULL) | 137 | if (res == NULL) { |
136 | return -EBUSY; | 138 | err = -EBUSY; |
139 | goto fail_free; | ||
140 | } | ||
137 | 141 | ||
138 | ep93xx_rtc->mmio_base = ioremap(res->start, resource_size(res)); | 142 | ep93xx_rtc->mmio_base = ioremap(res->start, resource_size(res)); |
139 | if (ep93xx_rtc->mmio_base == NULL) { | 143 | if (ep93xx_rtc->mmio_base == NULL) { |
@@ -169,6 +173,8 @@ fail: | |||
169 | pdev->dev.platform_data = NULL; | 173 | pdev->dev.platform_data = NULL; |
170 | } | 174 | } |
171 | release_mem_region(res->start, resource_size(res)); | 175 | release_mem_region(res->start, resource_size(res)); |
176 | fail_free: | ||
177 | kfree(ep93xx_rtc); | ||
172 | return err; | 178 | return err; |
173 | } | 179 | } |
174 | 180 | ||