Commit fb11c7f9 authored by Michael Thalmeier's avatar Michael Thalmeier Committed by Thadeu Lima de Souza Cascardo

usb: chipidea: debug: check before accessing ci_role

BugLink: http://bugs.launchpad.net/bugs/1698799

commit 0340ff83 upstream.

ci_role BUGs when the role is >= CI_ROLE_END.
Signed-off-by: default avatarMichael Thalmeier <michael.thalmeier@hale.at>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 0ba56fea
......@@ -295,7 +295,8 @@ static int ci_role_show(struct seq_file *s, void *data)
{
struct ci_hdrc *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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment