Commit 987d864a authored by Quentin Deslandes's avatar Quentin Deslandes Committed by Greg Kroah-Hartman

staging: vt6656: manage error path during device initialization

Check for error during device initialization callback and return a
meaningful error code or zero on success.
Signed-off-by: default avatarQuentin Deslandes <quentin.deslandes@itdev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 07ba60a1
...@@ -529,28 +529,34 @@ static void vnt_tx_80211(struct ieee80211_hw *hw, ...@@ -529,28 +529,34 @@ static void vnt_tx_80211(struct ieee80211_hw *hw,
static int vnt_start(struct ieee80211_hw *hw) static int vnt_start(struct ieee80211_hw *hw)
{ {
int ret = 0;
struct vnt_private *priv = hw->priv; struct vnt_private *priv = hw->priv;
priv->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS; priv->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS;
if (!vnt_alloc_bufs(priv)) { ret = vnt_alloc_bufs(priv);
if (ret) {
dev_dbg(&priv->usb->dev, "vnt_alloc_bufs fail...\n"); dev_dbg(&priv->usb->dev, "vnt_alloc_bufs fail...\n");
return -ENOMEM; goto err;
} }
clear_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags); clear_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags);
if (vnt_init_registers(priv) == false) { ret = vnt_init_registers(priv);
if (ret) {
dev_dbg(&priv->usb->dev, " init register fail\n"); dev_dbg(&priv->usb->dev, " init register fail\n");
goto free_all; goto free_all;
} }
if (vnt_key_init_table(priv)) ret = vnt_key_init_table(priv);
if (ret)
goto free_all; goto free_all;
priv->int_interval = 1; /* bInterval is set to 1 */ priv->int_interval = 1; /* bInterval is set to 1 */
vnt_int_start_interrupt(priv); ret = vnt_int_start_interrupt(priv);
if (ret)
goto free_all;
ieee80211_wake_queues(hw); ieee80211_wake_queues(hw);
...@@ -563,8 +569,8 @@ static int vnt_start(struct ieee80211_hw *hw) ...@@ -563,8 +569,8 @@ static int vnt_start(struct ieee80211_hw *hw)
usb_kill_urb(priv->interrupt_urb); usb_kill_urb(priv->interrupt_urb);
usb_free_urb(priv->interrupt_urb); usb_free_urb(priv->interrupt_urb);
err:
return -ENOMEM; return ret;
} }
static void vnt_stop(struct ieee80211_hw *hw) static void vnt_stop(struct ieee80211_hw *hw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment