Commit 69de4a85 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: fix oops in io_edgeport.c driver

This fixes https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=128916Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 9e36cd45
...@@ -2797,9 +2797,12 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio ...@@ -2797,9 +2797,12 @@ static void change_port_settings (struct edgeport_port *edge_port, struct termio
static void unicode_to_ascii (char *string, __le16 *unicode, int unicode_size) static void unicode_to_ascii (char *string, __le16 *unicode, int unicode_size)
{ {
int i; int i;
for (i = 0; i < unicode_size; ++i) {
if (unicode_size <= 0)
return;
for (i = 0; i < unicode_size; ++i)
string[i] = (char)(le16_to_cpu(unicode[i])); string[i] = (char)(le16_to_cpu(unicode[i]));
}
string[unicode_size] = 0x00; string[unicode_size] = 0x00;
} }
......
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