All of lore.kernel.org
 help / color / mirror / Atom feed
* upcoming pull request for v3.6-rcX - net/master
@ 2012-08-10  8:54 Marc Kleine-Budde
  2012-08-10  8:54 ` [PATCH 1/2] can: softing: Fix potential memory leak in softing_load_fw() Marc Kleine-Budde
  2012-08-10  8:54 ` [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing Marc Kleine-Budde
  0 siblings, 2 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-08-10  8:54 UTC (permalink / raw)
  To: linux-can

Hello,

I'm going to send this two patches to David. Tests and comments welcome.

Marc


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] can: softing: Fix potential memory leak in softing_load_fw()
  2012-08-10  8:54 upcoming pull request for v3.6-rcX - net/master Marc Kleine-Budde
@ 2012-08-10  8:54 ` Marc Kleine-Budde
  2012-08-10  8:54 ` [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing Marc Kleine-Budde
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-08-10  8:54 UTC (permalink / raw)
  To: linux-can; +Cc: Alexey Khoroshilov, Marc Kleine-Budde

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

Do not leak memory by updating pointer with potentially NULL realloc return value.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/softing/softing_fw.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c
index 3105961..b595d34 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);
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing
  2012-08-10  8:54 upcoming pull request for v3.6-rcX - net/master Marc Kleine-Budde
  2012-08-10  8:54 ` [PATCH 1/2] can: softing: Fix potential memory leak in softing_load_fw() Marc Kleine-Budde
@ 2012-08-10  8:54 ` Marc Kleine-Budde
  2012-08-10  8:57   ` Marc Kleine-Budde
       [not found]   ` <1901872510.399.1344589036713.JavaMail.trustmail@VW2BWOSEVG04>
  1 sibling, 2 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-08-10  8:54 UTC (permalink / raw)
  To: linux-can; +Cc: Schmitt, Sven (EVM/8), Sven Schmitt, Marc Kleine-Budde

From: "Schmitt, Sven (EVM/8)" <Sven.Schmitt@volkswagen.de>

The sja1000 platform driver wrongly assumes that a shared IRQ is indicated
with the IRQF_SHARED flag in irq resource flags. This patch changes the
driver to handle the correct flag IORESOURCE_IRQ_SHAREABLE instead.

There are no mainline users of the platform driver which wrongly make use
of IRQF_SHARED.

Signed-off-by: Sven Schmitt <sven.schmitt@volkswagen.de>
Acked-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/sja1000/sja1000_platform.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index 4f50145..662c5f7 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)
 	priv = netdev_priv(dev);
 
 	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;
 	/* The CAN clock frequency is half the oscillator clock frequency */
 	priv->can.clock.freq = pdata->osc_freq / 2;
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing
  2012-08-10  8:54 ` [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing Marc Kleine-Budde
@ 2012-08-10  8:57   ` Marc Kleine-Budde
       [not found]   ` <1901872510.399.1344589036713.JavaMail.trustmail@VW2BWOSEVG04>
  1 sibling, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-08-10  8:57 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, Schmitt, Sven (EVM/8)

[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]

Hello Sven,

On 08/10/2012 10:54 AM, Marc Kleine-Budde wrote:
> From: "Schmitt, Sven (EVM/8)" <Sven.Schmitt@volkswagen.de>
> 
> The sja1000 platform driver wrongly assumes that a shared IRQ is indicated
> with the IRQF_SHARED flag in irq resource flags. This patch changes the
> driver to handle the correct flag IORESOURCE_IRQ_SHAREABLE instead.
> 
> There are no mainline users of the platform driver which wrongly make use
> of IRQF_SHARED.
> 
> Signed-off-by: Sven Schmitt <sven.schmitt@volkswagen.de>
> Acked-by: Yegor Yefremov <yegorslists@googlemail.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

I just noticed that your email addresses are slightly different, which
do you prefer?

    "Schmitt, Sven (EVM/8)" <Sven.Schmitt@volkswagen.de>
    Sven Schmitt <sven.schmitt@volkswagen.de>

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* AW: [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing
       [not found]   ` <1901872510.399.1344589036713.JavaMail.trustmail@VW2BWOSEVG04>
@ 2012-08-10  9:11     ` Schmitt, Sven (EVM/8)
  2012-08-10  9:22       ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Schmitt, Sven (EVM/8) @ 2012-08-10  9:11 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can

I prefer the simple one:
Sven Schmitt <sven.schmitt@volkswagen.de>

i am checking if my mail client allows me to use this simple one.

Sven


-----Ursprüngliche Nachricht-----
Von: linux-can-owner@vger.kernel.org [mailto:linux-can-owner@vger.kernel.org] Im Auftrag von Marc Kleine-Budde
Gesendet: Freitag, 10. August 2012 10:57
An: Marc Kleine-Budde
Cc: linux-can@vger.kernel.org; Schmitt, Sven (EVM/8)
Betreff: Re: [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing

Hello Sven,

On 08/10/2012 10:54 AM, Marc Kleine-Budde wrote:
> From: "Schmitt, Sven (EVM/8)" <Sven.Schmitt@volkswagen.de>
> 
> The sja1000 platform driver wrongly assumes that a shared IRQ is indicated
> with the IRQF_SHARED flag in irq resource flags. This patch changes the
> driver to handle the correct flag IORESOURCE_IRQ_SHAREABLE instead.
> 
> There are no mainline users of the platform driver which wrongly make use
> of IRQF_SHARED.
> 
> Signed-off-by: Sven Schmitt <sven.schmitt@volkswagen.de>
> Acked-by: Yegor Yefremov <yegorslists@googlemail.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

I just noticed that your email addresses are slightly different, which
do you prefer?

    "Schmitt, Sven (EVM/8)" <Sven.Schmitt@volkswagen.de>
    Sven Schmitt <sven.schmitt@volkswagen.de>

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: AW: [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing
  2012-08-10  9:11     ` AW: " Schmitt, Sven (EVM/8)
@ 2012-08-10  9:22       ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-08-10  9:22 UTC (permalink / raw)
  To: Schmitt, Sven (EVM/8); +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

On 08/10/2012 11:11 AM, Schmitt, Sven (EVM/8) wrote:
> I prefer the simple one:
> Sven Schmitt <sven.schmitt@volkswagen.de>
> 
> i am checking if my mail client allows me to use this simple one.

Okay, I'm changing the author of the commit then.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-10  9:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-10  8:54 upcoming pull request for v3.6-rcX - net/master Marc Kleine-Budde
2012-08-10  8:54 ` [PATCH 1/2] can: softing: Fix potential memory leak in softing_load_fw() Marc Kleine-Budde
2012-08-10  8:54 ` [PATCH 2/2] can: sja1000_platform: fix wrong flag IRQF_SHARED for interrupt sharing Marc Kleine-Budde
2012-08-10  8:57   ` Marc Kleine-Budde
     [not found]   ` <1901872510.399.1344589036713.JavaMail.trustmail@VW2BWOSEVG04>
2012-08-10  9:11     ` AW: " Schmitt, Sven (EVM/8)
2012-08-10  9:22       ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.