linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: clabbe.montjoie@gmail.com (Corentin Labbe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] crypto: stm32 - Support for STM32 CRC32 crypto module
Date: Tue, 14 Mar 2017 20:39:54 +0100	[thread overview]
Message-ID: <20170314193954.GA12137@Red> (raw)
In-Reply-To: <1489509446-32283-3-git-send-email-fabien.dessenne@st.com>

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

  reply	other threads:[~2017-03-14 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 16:37 [PATCH 0/4] STM32 CRC crypto driver Fabien Dessenne
2017-03-14 16:37 ` [PATCH 1/4] dt-bindings: Document STM32 CRC bindings Fabien Dessenne
2017-03-14 16:37 ` [PATCH 2/4] crypto: stm32 - Support for STM32 CRC32 crypto module Fabien Dessenne
2017-03-14 19:39   ` Corentin Labbe [this message]
2017-03-14 16:37 ` [PATCH 3/4] ARM: dts: stm32: Add CRC support to stm32f746 Fabien Dessenne
2017-03-14 16:37 ` [PATCH 4/4] ARM: dts: stm32: enable CRC on stm32746g-eval board Fabien Dessenne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314193954.GA12137@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).