summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/softing/softing_fw.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-09-16 19:24:53 -0700
committerOlof Johansson <olof@lixom.net>2012-09-16 19:24:53 -0700
commitd1226e8f98f130918265fb5b4dddcb60b783eb34 (patch)
tree5272a7828311a9b336d15c005704cf27b083d41c /drivers/net/can/softing/softing_fw.c
parentcccc277ba840f32d252a785ab1df686fdc0f49f5 (diff)
parent47d85ec2a23552fd3d8b56778a23a5a843c5b9b1 (diff)
Merge tag 'devel-omap-device-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
Kevin Hilman <khilman@ti.com>: Updates for omap_device layer for v3.7. Allows omap_device layer to keep track of driver bound status in order to make more intelligent decisions about idling unused devices. * tag 'devel-omap-device-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: omap_device: idle devices with no driver bound ARM: OMAP: omap_device: don't attempt late suspend if no driver bound ARM: OMAP: omap_device: keep track of driver bound status + sync to 3.6-rc5
Diffstat (limited to 'drivers/net/can/softing/softing_fw.c')
-rw-r--r--drivers/net/can/softing/softing_fw.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c
index 31059617567..b595d3422b9 100644
--- a/drivers/net/can/softing/softing_fw.c
+++ b/drivers/net/can/softing/softing_fw.c
@@ -150,7 +150,7 @@ int softing_load_fw(const char *file, struct softing *card,
const uint8_t *mem, *end, *dat;
uint16_t type, len;
uint32_t addr;
- uint8_t *buf = NULL;
+ uint8_t *buf = NULL, *new_buf;
int buflen = 0;
int8_t type_end = 0;
@@ -199,11 +199,12 @@ int softing_load_fw(const char *file, struct softing *card,
if (len > buflen) {
/* align buflen */
buflen = (len + (1024-1)) & ~(1024-1);
- buf = krealloc(buf, buflen, GFP_KERNEL);
- if (!buf) {
+ new_buf = krealloc(buf, buflen, GFP_KERNEL);
+ if (!new_buf) {
ret = -ENOMEM;
goto failed;
}
+ buf = new_buf;
}
/* verify record data */
memcpy_fromio(buf, &dpram[addr + offset], len);