[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331307806-21761-2-git-send-email-jhovold@gmail.com>
Date: Fri, 9 Mar 2012 16:43:24 +0100
From: Johan Hovold <jhovold@...il.com>
To: Marcel Holtmann <marcel@...tmann.org>,
"Gustavo F. Padovan" <padovan@...fusion.mobi>
Cc: "David S. Miller" <davem@...emloft.net>,
linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org,
David Herrmann <dh.herrmann@...glemail.com>,
Greg KH <gregkh@...uxfoundation.org>,
Johan Hovold <jhovold@...il.com>,
stable <stable@...r.kernel.org>
Subject: [PATCH 1/3] bluetooth: hci_ldisc: fix memory leak on tty_close
The hci_uart is never freed when tty is closed if the protocol has not
been set.
This was discovered by David Hermann and fixed in bluetooth-next. Those
patches are more intrusive as they remove the mandatory destructor
completely.
This is the minimal fix, which leaves the destructor as an empty dummy
call for now.
Cc: David Herrmann <dh.herrmann@...glemail.com>
Cc: stable <stable@...r.kernel.org>
Signed-off-by: Johan Hovold <jhovold@...il.com>
---
drivers/bluetooth/hci_ldisc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 0711448..97c5faa 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -237,7 +237,6 @@ static void hci_uart_destruct(struct hci_dev *hdev)
return;
BT_DBG("%s", hdev->name);
- kfree(hdev->driver_data);
}
/* ------ LDISC part ------ */
@@ -316,6 +315,7 @@ static void hci_uart_tty_close(struct tty_struct *tty)
hci_free_dev(hdev);
}
}
+ kfree(hu);
}
}
--
1.7.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists