Skip to content

Commit

Permalink
usb: musb_debugfs: don't use the struct file private_data field with …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Mathias Nyman authored and Greg Kroah-Hartman committed Sep 20, 2010
1 parent 2422084 commit 024cfa5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/musb/musb_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,14 @@ static const struct file_operations musb_regdump_fops = {

static int musb_test_mode_open(struct inode *inode, struct file *file)
{
file->private_data = inode->i_private;

return single_open(file, musb_test_mode_show, inode->i_private);
}

static ssize_t musb_test_mode_write(struct file *file,
const char __user *ubuf, size_t count, loff_t *ppos)
{
struct musb *musb = file->private_data;
struct seq_file *s = file->private_data;
struct musb *musb = s->private;
u8 test = 0;
char buf[18];

Expand Down

0 comments on commit 024cfa5

Please sign in to comment.