Skip to contentSkip to conversation

gpio: max730x: Remove kfree(ts) in __max730x_remove()

PATCH In review Axel Lin 4 participants 4 messages Apr 14, 2014 – Apr 22, 2014 GPIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: max730x: Remove kfree(ts) in __max730x_remove()

Quoted 1 line

From f52622585aeb4cf785c78548e440993a1e9625b1 Mon Sep 17 00:00:00 2001

From: Axel Lin <[email protected]>
Date: Mon, 14 Apr 2014 15:20:15 +0800
Subject: [PATCH] gpio: max730x: Remove kfree(ts) in __max730x_remove()

The memory for ts is allocated by devm_kzalloc now, so the kfree is not required.

---
I think this change is missed in:
commit c3fe2bf4916 gpio: max7300: use devm_kzalloc() commit 4cb06cd58c2 gpio: max7301: use devm_kzalloc()

 drivers/gpio/gpio-max730x.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpio/gpio-max730x.c +2 -3
index 8672755..0814584 100644
@@ -237,10 +237,9 @@ int __max730x_remove(struct device *dev)
 	ts->write(dev, 0x04, 0x00);
 
 	ret = gpiochip_remove(&ts->chip);
-	if (!ret) {
+	if (!ret)
 		mutex_destroy(&ts->lock);
-		kfree(ts);
-	} else
+	else
 		dev_err(dev, "Failed to remove GPIO controller: %d\n", ret);
 
 	return ret;
Signature · 1 line
1.8.3.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Monday 14 April 2014 09:30:41 Axel Lin wrote:

From f52622585aeb4cf785c78548e440993a1e9625b1 Mon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Mon, 14 Apr 2014 15:20:15 +0800
Subject: [PATCH] gpio: max730x: Remove kfree(ts) in __max730x_remove()

The memory for ts is allocated by devm_kzalloc now, so the kfree is not required.

Good catch.

Signature · 6 lines
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by
#2 lore raw
Quoted 6 lines · Juergen Beisert
Quoted 5 lines · On Monday 14 April 2014 09:30:41 Axel Lin wrote:

From f52622585aeb4cf785c78548e440993a1e9625b1 Mon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Mon, 14 Apr 2014 15:20:15 +0800
Subject: [PATCH] gpio: max730x: Remove kfree(ts) in __max730x_remove()

Quoted 8 lines
Quoted 4 lines

The memory for ts is allocated by devm_kzalloc now, so the kfree is not required.

Good catch.

Best regards,
Jingoo Han

Quoted 4 lines

--

Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |
#3 lore raw
In reply to Axel Lin
Quoted 9 lines · Axel Lin

From f52622585aeb4cf785c78548e440993a1e9625b1 Mon Sep 17 00:00:00 2001
From: Axel Lin <[email protected]>
Date: Mon, 14 Apr 2014 15:20:15 +0800
Subject: [PATCH] gpio: max730x: Remove kfree(ts) in __max730x_remove()

The memory for ts is allocated by devm_kzalloc now, so the kfree is not required.

Patch applied with all ACKs, also fixed up this weird commit message.

Yours,
Linus Walleij