Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd5c2ed6 authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarDavid S. Miller <davem@davemloft.net>
parents d05cebb9 da3d50ef
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -109,7 +109,9 @@ static int sp_probe(struct platform_device *pdev)
	priv = netdev_priv(dev);
	priv = netdev_priv(dev);


	dev->irq = res_irq->start;
	dev->irq = res_irq->start;
	priv->irq_flags = res_irq->flags & (IRQF_TRIGGER_MASK | IRQF_SHARED);
	priv->irq_flags = res_irq->flags & IRQF_TRIGGER_MASK;
	if (res_irq->flags & IORESOURCE_IRQ_SHAREABLE)
		priv->irq_flags |= IRQF_SHARED;
	priv->reg_base = addr;
	priv->reg_base = addr;
	/* The CAN clock frequency is half the oscillator clock frequency */
	/* The CAN clock frequency is half the oscillator clock frequency */
	priv->can.clock.freq = pdata->osc_freq / 2;
	priv->can.clock.freq = pdata->osc_freq / 2;
+4 −3
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ int softing_load_fw(const char *file, struct softing *card,
	const uint8_t *mem, *end, *dat;
	const uint8_t *mem, *end, *dat;
	uint16_t type, len;
	uint16_t type, len;
	uint32_t addr;
	uint32_t addr;
	uint8_t *buf = NULL;
	uint8_t *buf = NULL, *new_buf;
	int buflen = 0;
	int buflen = 0;
	int8_t type_end = 0;
	int8_t type_end = 0;


@@ -199,11 +199,12 @@ int softing_load_fw(const char *file, struct softing *card,
		if (len > buflen) {
		if (len > buflen) {
			/* align buflen */
			/* align buflen */
			buflen = (len + (1024-1)) & ~(1024-1);
			buflen = (len + (1024-1)) & ~(1024-1);
			buf = krealloc(buf, buflen, GFP_KERNEL);
			new_buf = krealloc(buf, buflen, GFP_KERNEL);
			if (!buf) {
			if (!new_buf) {
				ret = -ENOMEM;
				ret = -ENOMEM;
				goto failed;
				goto failed;
			}
			}
			buf = new_buf;
		}
		}
		/* verify record data */
		/* verify record data */
		memcpy_fromio(buf, &dpram[addr + offset], len);
		memcpy_fromio(buf, &dpram[addr + offset], len);