All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] Staging: ti-st: writing past end of array
@ 2010-08-10  5:36 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-08-10  5:36 UTC (permalink / raw)
  To: kernel-janitors

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>

diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c
index 063c9b1..0dfed21 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++;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-10  5:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-10  5:36 [patch] Staging: ti-st: writing past end of array Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.