aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Thalmeier <michael.thalmeier@hale.at>2017-05-18 16:14:14 +0200
committerMoyster <oysterized@gmail.com>2017-11-06 15:19:10 +0100
commitd9b41a5b81a78e61ba650a67e138d8b88b43ad79 (patch)
tree59ff42e9e502c8a5b21033cec8317b9d769d7108 /drivers
parente79c756545c8ce78d3efb585bc92c029cd5a969b (diff)
usb: chipidea: debug: check before accessing ci_role
commit 0340ff83cd4475261e7474033a381bc125b45244 upstream. ci_role BUGs when the role is >= CI_ROLE_END. Cc: stable@vger.kernel.org #v3.10+ Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 36a7063a6..5a38ca87f 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -203,7 +203,8 @@ static int ci_role_show(struct seq_file *s, void *data)
{
struct ci13xxx *ci = s->private;
- seq_printf(s, "%s\n", ci_role(ci)->name);
+ if (ci->role != CI_ROLE_END)
+ seq_printf(s, "%s\n", ci_role(ci)->name);
return 0;
}