On Tue, Mar 14, 2017 at 05:37:24PM +0100, Fabien Dessenne wrote:
> +static int stm32_crc_remove(struct platform_device *pdev)
> +{
> + struct stm32_crc *crc = platform_get_drvdata(pdev);
> +
> + spin_lock(&crc_list.lock);
> + list_del(&crc->list);
> + spin_unlock(&crc_list.lock);
> +
> + crypto_unregister_shash(algs);
> +
> + if (crc && crc->clk)
> + clk_disable_unprepare(crc->clk);
Hello
No need to test for crc, if it was NULL, you dereference it just before in
list_del.
Furthermore, It seems that clk_disable_unprepare() handle perfectly NULL, so no
test is needed.
Regards
Corentin Labbe