Skip to content

Commit

Permalink
Staging: ti-st: writing past end of array
Browse files Browse the repository at this point in the history
In the original source it would write past the end of the array before
returning the error code.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent 2a8a4b7 commit 0b6e722
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/staging/ti-st/st_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,8 @@ long st_register(struct st_proto_s *new_proto)
default:
pr_err("%d protocol not supported",
new_proto->type);
err = -EPROTONOSUPPORT;
/* something wrong */
break;
spin_unlock_irqrestore(&st_gdata->lock, flags);
return -EPROTONOSUPPORT;
}
st_gdata->list[new_proto->type] = new_proto;
st_gdata->protos_registered++;
Expand Down

0 comments on commit 0b6e722

Please sign in to comment.