Commit cf10e78e authored by Tobin C. Harding's avatar Tobin C. Harding Committed by Greg Kroah-Hartman

staging: ks7010: remove unused read_buf

Driver SDIO code allocates memory for a buffer that is never used. It
can be safely removed.

Remove unused buffer, including allocation and freeing of memory.
Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa125ae4
...@@ -952,10 +952,6 @@ static int ks7010_sdio_probe(struct sdio_func *func, ...@@ -952,10 +952,6 @@ static int ks7010_sdio_probe(struct sdio_func *func,
/* private memory initialize */ /* private memory initialize */
priv->ks_wlan_hw.sdio_card = card; priv->ks_wlan_hw.sdio_card = card;
priv->ks_wlan_hw.read_buf = NULL;
priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
if (!priv->ks_wlan_hw.read_buf)
goto err_free_netdev;
priv->dev_state = DEVICE_STATE_PREBOOT; priv->dev_state = DEVICE_STATE_PREBOOT;
priv->net_dev = netdev; priv->net_dev = netdev;
...@@ -982,7 +978,7 @@ static int ks7010_sdio_probe(struct sdio_func *func, ...@@ -982,7 +978,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
dev_err(&card->func->dev, dev_err(&card->func->dev,
"ks7010: firmware load failed !! return code = %d\n", "ks7010: firmware load failed !! return code = %d\n",
ret); ret);
goto err_free_read_buf; goto err_free_netdev;
} }
/* interrupt setting */ /* interrupt setting */
...@@ -1010,7 +1006,7 @@ static int ks7010_sdio_probe(struct sdio_func *func, ...@@ -1010,7 +1006,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq"); priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq");
if (!priv->ks_wlan_hw.ks7010sdio_wq) { if (!priv->ks_wlan_hw.ks7010sdio_wq) {
DPRINTK(1, "create_workqueue failed !!\n"); DPRINTK(1, "create_workqueue failed !!\n");
goto err_free_read_buf; goto err_free_netdev;
} }
INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function); INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function);
...@@ -1018,13 +1014,10 @@ static int ks7010_sdio_probe(struct sdio_func *func, ...@@ -1018,13 +1014,10 @@ static int ks7010_sdio_probe(struct sdio_func *func,
ret = register_netdev(priv->net_dev); ret = register_netdev(priv->net_dev);
if (ret) if (ret)
goto err_free_read_buf; goto err_free_netdev;
return 0; return 0;
err_free_read_buf:
kfree(priv->ks_wlan_hw.read_buf);
priv->ks_wlan_hw.read_buf = NULL;
err_free_netdev: err_free_netdev:
free_netdev(priv->net_dev); free_netdev(priv->net_dev);
card->priv = NULL; card->priv = NULL;
...@@ -1117,7 +1110,6 @@ static void ks7010_sdio_remove(struct sdio_func *func) ...@@ -1117,7 +1110,6 @@ static void ks7010_sdio_remove(struct sdio_func *func)
unregister_netdev(netdev); unregister_netdev(netdev);
trx_device_exit(priv); trx_device_exit(priv);
kfree(priv->ks_wlan_hw.read_buf);
free_netdev(priv->net_dev); free_netdev(priv->net_dev);
card->priv = NULL; card->priv = NULL;
} }
......
...@@ -92,7 +92,6 @@ struct hw_info_t { ...@@ -92,7 +92,6 @@ struct hw_info_t {
struct ks_sdio_card *sdio_card; struct ks_sdio_card *sdio_card;
struct workqueue_struct *ks7010sdio_wq; struct workqueue_struct *ks7010sdio_wq;
struct delayed_work rw_wq; struct delayed_work rw_wq;
unsigned char *read_buf;
struct tasklet_struct rx_bh_task; struct tasklet_struct rx_bh_task;
}; };
......
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