USB: OTG: msm: Fix bug in msm_otg_mode_write
authorPavankumar Kondeti <pkondeti@codeaurora.org>
Tue, 15 Feb 2011 04:12:35 +0000 (09:42 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 18:55:15 +0000 (10:55 -0800)
The driver private data is retrieved incorrectly which results
a crash when written into "mode" debugfs file.

Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/otg/msm72k_otg.c

index 4d79017c16f3337f18efa6c1388ef52ba6a97ebe..296598628b853b2e9bf9586dd563cbdd34412606 100644 (file)
@@ -723,7 +723,8 @@ static int msm_otg_mode_open(struct inode *inode, struct file *file)
 static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf,
                                size_t count, loff_t *ppos)
 {
-       struct msm_otg *motg = file->private_data;
+       struct seq_file *s = file->private_data;
+       struct msm_otg *motg = s->private;
        char buf[16];
        struct otg_transceiver *otg = &motg->otg;
        int status = count;