diff options
author | Mathias Nyman <mathias.nyman@nokia.com> | 2010-09-06 06:52:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-20 19:04:56 -0400 |
commit | 024cfa5943a7e89565c60b612d698c2bfb3da66a (patch) | |
tree | 031e0d89f8066dbd4099f870cbd82fe0aa4d75db /drivers | |
parent | 2422084a94fcd5038406261b331672a13c92c050 (diff) |
usb: musb_debugfs: don't use the struct file private_data field with seq_files
seq_files use the private_data field of a file struct for storing a seq_file structure,
data should be stored in seq_file's own private field (e.g. file->private_data->private)
Otherwise seq_release() will free the private data when the file is closed.
Signed-off-by: Mathias Nyman <mathias.nyman@nokia.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/musb/musb_debugfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c index c79a5e30d437..9e8639d4e862 100644 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c | |||
@@ -195,15 +195,14 @@ static const struct file_operations musb_regdump_fops = { | |||
195 | 195 | ||
196 | static int musb_test_mode_open(struct inode *inode, struct file *file) | 196 | static int musb_test_mode_open(struct inode *inode, struct file *file) |
197 | { | 197 | { |
198 | file->private_data = inode->i_private; | ||
199 | |||
200 | return single_open(file, musb_test_mode_show, inode->i_private); | 198 | return single_open(file, musb_test_mode_show, inode->i_private); |
201 | } | 199 | } |
202 | 200 | ||
203 | static ssize_t musb_test_mode_write(struct file *file, | 201 | static ssize_t musb_test_mode_write(struct file *file, |
204 | const char __user *ubuf, size_t count, loff_t *ppos) | 202 | const char __user *ubuf, size_t count, loff_t *ppos) |
205 | { | 203 | { |
206 | struct musb *musb = file->private_data; | 204 | struct seq_file *s = file->private_data; |
205 | struct musb *musb = s->private; | ||
207 | u8 test = 0; | 206 | u8 test = 0; |
208 | char buf[18]; | 207 | char buf[18]; |
209 | 208 | ||