diff options
author | David S. Miller <davem@davemloft.net> | 2012-08-24 15:21:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-24 15:21:13 -0400 |
commit | cd5c2ed6fea362a295a3494ca97fa2e47f5bf49a (patch) | |
tree | b875096f5e91ad6163f26b91c3d1a6b40125350b /drivers | |
parent | d05cebb9153e500648befaa6f135e6976bbfbd84 (diff) | |
parent | da3d50ef308d53f216f1f92f4971f245c13e9f65 (diff) |
Merge branch 'fixes-for-3.6' of git://gitorious.org/linux-can/linux-can
Marc Kleine-Budde says:
====================
here are two fixes for the v3.6 release cycle. Alexey Khoroshilov submitted a
fix for a memory leak in the softing driver (in softing_load_fw()) in case a
krealloc() fails. Sven Schmitt fixed the misuse of the IRQF_SHARED flag in the
irq resouce of the sja1000 platform driver, now the correct flag is used. There
are no mainline users of this feature which need to be converted.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/can/sja1000/sja1000_platform.c | 4 | ||||
-rw-r--r-- | drivers/net/can/softing/softing_fw.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c index 4f50145f6483..662c5f7eb0c5 100644 --- a/drivers/net/can/sja1000/sja1000_platform.c +++ b/drivers/net/can/sja1000/sja1000_platform.c | |||
@@ -109,7 +109,9 @@ static int sp_probe(struct platform_device *pdev) | |||
109 | priv = netdev_priv(dev); | 109 | priv = netdev_priv(dev); |
110 | 110 | ||
111 | dev->irq = res_irq->start; | 111 | dev->irq = res_irq->start; |
112 | priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED); | 112 | priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK; |
113 | if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE) | ||
114 | priv->irq_flags |= IRQF_SHARED; | ||
113 | priv->reg_base = addr; | 115 | priv->reg_base = addr; |
114 | /* The CAN clock frequency is half the oscillator clock frequency */ | 116 | /* The CAN clock frequency is half the oscillator clock frequency */ |
115 | priv->can.clock.freq = pdata->osc_freq / 2; | 117 | priv->can.clock.freq = pdata->osc_freq / 2; |
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c index 310596175676..b595d3422b9f 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, | |||
150 | const uint8_t *mem, *end, *dat; | 150 | const uint8_t *mem, *end, *dat; |
151 | uint16_t type, len; | 151 | uint16_t type, len; |
152 | uint32_t addr; | 152 | uint32_t addr; |
153 | uint8_t *buf = NULL; | 153 | uint8_t *buf = NULL, *new_buf; |
154 | int buflen = 0; | 154 | int buflen = 0; |
155 | int8_t type_end = 0; | 155 | int8_t type_end = 0; |
156 | 156 | ||
@@ -199,11 +199,12 @@ int softing_load_fw(const char *file, struct softing *card, | |||
199 | if (len > buflen) { | 199 | if (len > buflen) { |
200 | /* align buflen */ | 200 | /* align buflen */ |
201 | buflen = (len + (1024-1)) & ~(1024-1); | 201 | buflen = (len + (1024-1)) & ~(1024-1); |
202 | buf = krealloc(buf, buflen, GFP_KERNEL); | 202 | new_buf = krealloc(buf, buflen, GFP_KERNEL); |
203 | if (!buf) { | 203 | if (!new_buf) { |
204 | ret = -ENOMEM; | 204 | ret = -ENOMEM; |
205 | goto failed; | 205 | goto failed; |
206 | } | 206 | } |
207 | buf = new_buf; | ||
207 | } | 208 | } |
208 | /* verify record data */ | 209 | /* verify record data */ |
209 | memcpy_fromio(buf, &dpram[addr + offset], len); | 210 | memcpy_fromio(buf, &dpram[addr + offset], len); |