summaryrefslogtreecommitdiff
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorAndy Voltz <andy.voltz@timesys.com>2010-11-15 16:00:38 -0500
committerAndy Voltz <andy.voltz@timesys.com>2010-11-17 11:30:34 -0500
commit2e0ae4bf137e282e825b27b02eb46f86c59d004e (patch)
tree7c2534acd757ca414f02c5b983ee67eb2b2493c6 /net/bluetooth/sco.c
parent22763c5cf3690a681551162c15d34d935308c8d7 (diff)
Bump Linux kernel to 2.6.32.25
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r--net/bluetooth/sco.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 77f4153bdb5e..5c0685eba947 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -957,13 +957,22 @@ static ssize_t sco_sysfs_show(struct class *dev, char *buf)
struct sock *sk;
struct hlist_node *node;
char *str = buf;
+ int size = PAGE_SIZE;
read_lock_bh(&sco_sk_list.lock);
sk_for_each(sk, node, &sco_sk_list.head) {
- str += sprintf(str, "%s %s %d\n",
+ int len;
+
+ len = snprintf(str, size, "%s %s %d\n",
batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
sk->sk_state);
+
+ size -= len;
+ if (size <= 0)
+ break;
+
+ str += len;
}
read_unlock_bh(&sco_sk_list.lock);