mirror of https://gitee.com/openkylin/linux.git
staging: ks7010: Delete unnecessary checks before the function call "kfree"
The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
68d81dea4f
commit
58043f2527
|
@ -732,7 +732,6 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
error_out:
|
error_out:
|
||||||
if (data_buf)
|
|
||||||
kfree(data_buf);
|
kfree(data_buf);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -763,7 +762,6 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
error_out:
|
error_out:
|
||||||
if (read_buf)
|
|
||||||
kfree(read_buf);
|
kfree(read_buf);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -879,7 +877,6 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
|
||||||
release_firmware(fw_entry);
|
release_firmware(fw_entry);
|
||||||
error_out0:
|
error_out0:
|
||||||
sdio_release_host(card->func);
|
sdio_release_host(card->func);
|
||||||
if (rom_buf)
|
|
||||||
kfree(rom_buf);
|
kfree(rom_buf);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -1199,9 +1196,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
|
||||||
unregister_netdev(netdev);
|
unregister_netdev(netdev);
|
||||||
|
|
||||||
trx_device_exit(priv);
|
trx_device_exit(priv);
|
||||||
if (priv->ks_wlan_hw.read_buf) {
|
|
||||||
kfree(priv->ks_wlan_hw.read_buf);
|
kfree(priv->ks_wlan_hw.read_buf);
|
||||||
}
|
|
||||||
free_netdev(priv->net_dev);
|
free_netdev(priv->net_dev);
|
||||||
card->priv = NULL;
|
card->priv = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue