Commit 0b6e7220 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: ti-st: writing past end of array

In the original source it would write past the end of the array before
returning the error code.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2a8a4b75
...@@ -686,9 +686,8 @@ long st_register(struct st_proto_s *new_proto) ...@@ -686,9 +686,8 @@ long st_register(struct st_proto_s *new_proto)
default: default:
pr_err("%d protocol not supported", pr_err("%d protocol not supported",
new_proto->type); new_proto->type);
err = -EPROTONOSUPPORT; spin_unlock_irqrestore(&st_gdata->lock, flags);
/* something wrong */ return -EPROTONOSUPPORT;
break;
} }
st_gdata->list[new_proto->type] = new_proto; st_gdata->list[new_proto->type] = new_proto;
st_gdata->protos_registered++; st_gdata->protos_registered++;
......
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