aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/stub_dev.c
diff options
context:
space:
mode:
authorBernard Blackham <bernard@largestprime.net>2012-10-22 06:45:00 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 13:38:04 -0700
commit3d0a2a22c91e58bfe933115d63cdce60ad2b3a11 (patch)
tree73c1fdcac0186bcadb54124a94d92d6b971f7c9b /drivers/staging/usbip/stub_dev.c
parentc7f0089931dfaefba81001c88449250867582ba6 (diff)
staging: usbip: Don't leak struct file.
usbip takes a reference on a struct file which is passed in via sysfs. Previously, this reference was never cleaned up, although the socket it referred to was. This patch drops the corresponding reference (found with the socket's ->file backpointer) instead of just closing the socket. Signed-off-by: Bernard Blackham <b-linuxgit@largestprime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/usbip/stub_dev.c')
-rw-r--r--drivers/staging/usbip/stub_dev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index 1e1eb4c14d7..79298d06863 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -18,6 +18,7 @@
*/
#include <linux/device.h>
+#include <linux/file.h>
#include <linux/kthread.h>
#include <linux/module.h>
@@ -203,7 +204,7 @@ static void stub_shutdown_connection(struct usbip_device *ud)
* not touch NULL socket.
*/
if (ud->tcp_socket) {
- sock_release(ud->tcp_socket);
+ fput(ud->tcp_socket->file);
ud->tcp_socket = NULL;
}