From 29daf3dc24ecdd9f0ec2c62545f963bd51d95ee9 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Wed, 14 Nov 2012 17:14:51 -0500 Subject: [PATCH] CHROMIUM: gobi: Remove leaky replacement of fops in devqmi_write The devqmi_write function sometimes overwrites devqmi_fops with def_chr_fops. When that happens, the devqmi_fops reference is leaked, and the file is never cleaned up because devqmi_release is not called. It's not clear what this is for, and it looks like the other file callbacks already check device_valid() before doing anything. Therefore we can probably just remove this. BUG=chrome-os-partner:16158 TEST=suspend_stress_test; stop cromo; cat /sys/module/gobi/refcnt Change-Id: Ie8aecf98784165629864c90b60ee1c20d2106bef Signed-off-by: Michael Spang Reviewed-on: https://gerrit.chromium.org/gerrit/38058 Reviewed-by: Vincent Palatin Reviewed-by: Mandeep Singh Baines --- drivers/net/usb/gobi/qmidevice.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/usb/gobi/qmidevice.c b/drivers/net/usb/gobi/qmidevice.c index d7bf4288ae4ed..e3d9d42ed99c7 100644 --- a/drivers/net/usb/gobi/qmidevice.c +++ b/drivers/net/usb/gobi/qmidevice.c @@ -1413,8 +1413,6 @@ static ssize_t devqmi_write(struct file *file, const char __user * buf, if (!device_valid(handle->dev)) { GOBI_WARN("invalid device"); - /* TODO(ttuttle): what the heck is this for: */ - file->f_op = file->f_dentry->d_inode->i_fop; return -ENXIO; } -- 2.39.5