diff options
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 9 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 155a2b93760e..77eab8f4c7fd 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -273,10 +273,10 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) | |||
273 | 273 | ||
274 | struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | 274 | struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) |
275 | { | 275 | { |
276 | struct rfcomm_dlc *d = kmalloc(sizeof(*d), prio); | 276 | struct rfcomm_dlc *d = kzalloc(sizeof(*d), prio); |
277 | |||
277 | if (!d) | 278 | if (!d) |
278 | return NULL; | 279 | return NULL; |
279 | memset(d, 0, sizeof(*d)); | ||
280 | 280 | ||
281 | init_timer(&d->timer); | 281 | init_timer(&d->timer); |
282 | d->timer.function = rfcomm_dlc_timeout; | 282 | d->timer.function = rfcomm_dlc_timeout; |
@@ -289,6 +289,7 @@ struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio) | |||
289 | rfcomm_dlc_clear_state(d); | 289 | rfcomm_dlc_clear_state(d); |
290 | 290 | ||
291 | BT_DBG("%p", d); | 291 | BT_DBG("%p", d); |
292 | |||
292 | return d; | 293 | return d; |
293 | } | 294 | } |
294 | 295 | ||
@@ -522,10 +523,10 @@ int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig) | |||
522 | /* ---- RFCOMM sessions ---- */ | 523 | /* ---- RFCOMM sessions ---- */ |
523 | static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) | 524 | static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state) |
524 | { | 525 | { |
525 | struct rfcomm_session *s = kmalloc(sizeof(*s), GFP_KERNEL); | 526 | struct rfcomm_session *s = kzalloc(sizeof(*s), GFP_KERNEL); |
527 | |||
526 | if (!s) | 528 | if (!s) |
527 | return NULL; | 529 | return NULL; |
528 | memset(s, 0, sizeof(*s)); | ||
529 | 530 | ||
530 | BT_DBG("session %p sock %p", s, sock); | 531 | BT_DBG("session %p sock %p", s, sock); |
531 | 532 | ||
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 2ff2d5b87c93..bd8d671a0ba6 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -169,10 +169,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) | |||
169 | 169 | ||
170 | BT_DBG("id %d channel %d", req->dev_id, req->channel); | 170 | BT_DBG("id %d channel %d", req->dev_id, req->channel); |
171 | 171 | ||
172 | dev = kmalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); | 172 | dev = kzalloc(sizeof(struct rfcomm_dev), GFP_KERNEL); |
173 | if (!dev) | 173 | if (!dev) |
174 | return -ENOMEM; | 174 | return -ENOMEM; |
175 | memset(dev, 0, sizeof(struct rfcomm_dev)); | ||
176 | 175 | ||
177 | write_lock_bh(&rfcomm_dev_lock); | 176 | write_lock_bh(&rfcomm_dev_lock); |
178 | 177 | ||