[PATCH 3/3] USB: OTG: msm: Fix bug in msm_otg_mode_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The driver private data is retrieved incorrectly which results
a crash when written into "mode" debugfs file.

Signed-off-by: Pavankumar Kondeti <pkondeti@xxxxxxxxxxxxxx>
---
 drivers/usb/otg/msm72k_otg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/otg/msm72k_otg.c b/drivers/usb/otg/msm72k_otg.c
index 4d79017..2965986 100644
--- a/drivers/usb/otg/msm72k_otg.c
+++ b/drivers/usb/otg/msm72k_otg.c
@@ -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;
-- 
1.7.1

--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux