[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <12291958721148-git-send-email-ilpo.jarvinen@helsinki.fi>
Date: Sat, 13 Dec 2008 21:17:48 +0200
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: [PATCH 08/11] bt/rfcomm/tty: join error paths
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
Cc: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Marcel Holtmann <marcel@...tmann.org>
---
net/bluetooth/rfcomm/tty.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 111c6c8..d030c69 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -298,18 +298,15 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
out:
write_unlock_bh(&rfcomm_dev_lock);
- if (err < 0) {
- kfree(dev);
- return err;
- }
+ if (err < 0)
+ goto free;
dev->tty_dev = tty_register_device(rfcomm_tty_driver, dev->id, NULL);
if (IS_ERR(dev->tty_dev)) {
err = PTR_ERR(dev->tty_dev);
list_del(&dev->list);
- kfree(dev);
- return err;
+ goto free;
}
dev_set_drvdata(dev->tty_dev, dev);
@@ -321,6 +318,10 @@ out:
BT_ERR("Failed to create channel attribute");
return dev->id;
+
+free:
+ kfree(dev);
+ return err;
}
static void rfcomm_dev_del(struct rfcomm_dev *dev)
--
1.5.2.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists