# \[PATCH 05/11\] serial: pic32\_uart: Fix double free of 'sport-\>irq\_fault\_name'.

- From: Purna Chandra Mandal \<hidden\>
- Date: 2016-05-17 05:08:32 
- List: linux-serial
- Page: https://ratatoskr.run/linux-serial/2016/05/4753078
- Thread: https://ratatoskr.run/linux-serial/2016/05/4753078/t.md

```text
Allocated memory for 'sport->irq_fault_name' is freed twice, first
in error check of 'if(!sport->irq_rx_name)' and other in fallback
handler.

Signed-off-by: Purna Chandra Mandal <redacted>

---

 drivers/tty/serial/pic32_uart.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index 62a43bf..7f8e99b 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -445,7 +445,6 @@ static int pic32_uart_startup(struct uart_port *port)
 				       sport->idx);
 	if (!sport->irq_rx_name) {
 		dev_err(port->dev, "%s: kasprintf err!", __func__);
-		kfree(sport->irq_fault_name);
 		ret = -ENOMEM;
 		goto out_f;
 	}
-- 
1.8.3.1
```
