提交 037322ab 编写于 作者: I Ilpo Järvinen 提交者: David S. Miller

bt/rfcomm/tty: join error paths

Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0eae1b98
......@@ -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 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
BT_ERR("Failed to create channel attribute");
return dev->id;
free:
kfree(dev);
return err;
}
static void rfcomm_dev_del(struct rfcomm_dev *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册