tty.c (05668381140309088443bf5dc53add4104610fbb) tty.c (25ea6db04a96d7871e7ece27d566f3228d59d932)
1/*
2 RFCOMM implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation;

--- 155 unchanged lines hidden (view full) ---

164static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
165{
166 struct rfcomm_dev *dev;
167 struct list_head *head = &rfcomm_dev_list, *p;
168 int err = 0;
169
170 BT_DBG("id %d channel %d", req->dev_id, req->channel);
171
1/*
2 RFCOMM implementation for Linux Bluetooth stack (BlueZ).
3 Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
4 Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation;

--- 155 unchanged lines hidden (view full) ---

164static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
165{
166 struct rfcomm_dev *dev;
167 struct list_head *head = &rfcomm_dev_list, *p;
168 int err = 0;
169
170 BT_DBG("id %d channel %d", req->dev_id, req->channel);
171
172 dev = kmalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
172 dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL);
173 if (!dev)
174 return -ENOMEM;
173 if (!dev)
174 return -ENOMEM;
175 memset(dev, 0, sizeof(struct rfcomm_dev));
176
177 write_lock_bh(&rfcomm_dev_lock);
178
179 if (req->dev_id < 0) {
180 dev->id = 0;
181
182 list_for_each(p, &rfcomm_dev_list) {
183 if (list_entry(p, struct rfcomm_dev, list)->id != dev->id)

--- 865 unchanged lines hidden ---
175
176 write_lock_bh(&rfcomm_dev_lock);
177
178 if (req->dev_id < 0) {
179 dev->id = 0;
180
181 list_for_each(p, &rfcomm_dev_list) {
182 if (list_entry(p, struct rfcomm_dev, list)->id != dev->id)

--- 865 unchanged lines hidden ---