From 0b6e7220ed2be6e40bbda4eeb2b9c397008f2cef Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 10 Aug 2010 07:36:24 +0200 Subject: [PATCH] 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: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ti-st/st_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c index 063c9b1db1ab..0dfed21721e5 100644 --- a/drivers/staging/ti-st/st_core.c +++ b/drivers/staging/ti-st/st_core.c @@ -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++; -- 2.30.2