Bluetooth: Fix using uninitialized variable
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 7 Mar 2012 18:20:14 +0000 (20:20 +0200)
committerGustavo F. Padovan <padovan@profusion.mobi>
Thu, 8 Mar 2012 05:20:22 +0000 (02:20 -0300)
+ src/net/bluetooth/rfcomm/tty.c: warning: 'p' is used uninitialized in this
       function:  => 218
+ src/net/bluetooth/rfcomm/tty.c: warning: 'p' may be used uninitialized in
       this function:  => 218

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/rfcomm/tty.c

index a2d4f5122a6a2030913814a8ebdc0cf6a381e29d..c179734f143f47f6045d7989f333c9b38db1fc7b 100644 (file)
@@ -196,7 +196,7 @@ static DEVICE_ATTR(channel, S_IRUGO, show_channel, NULL);
 static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
 {
        struct rfcomm_dev *dev, *entry;
-       struct list_head *head = &rfcomm_dev_list, *p;
+       struct list_head *head = &rfcomm_dev_list;
        int err = 0;
 
        BT_DBG("id %d channel %d", req->dev_id, req->channel);
@@ -215,7 +215,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
                                break;
 
                        dev->id++;
-                       head = p;
+                       head = &entry->list;
                }
        } else {
                dev->id = req->dev_id;
@@ -229,7 +229,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
                        if (entry->id > dev->id - 1)
                                break;
 
-                       head = p;
+                       head = &entry->list;
                }
        }