>From 0b6e7220ed2be6e40bbda4eeb2b9c397008f2cef Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Tue, 10 Aug 2010 07:36:24 +0200
Subject: [PATCH 15/24] 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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/ti-st/st_core.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

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++;
-- 
1.6.2.5

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Attachment: 0015-Staging-ti-st-writing-past-end-of-array.patch
Description: 0015-Staging-ti-st-writing-past-end-of-array.patch

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to