All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: linux-mmc@vger.kernel.org
Subject: [bug report] mmc: dw_mmc: Remove struct dw_mci_slot
Date: Fri, 19 Dec 2025 13:33:31 +0300	[thread overview]
Message-ID: <aUUp-x2ex9I_Nd57@stanley.mountain> (raw)

[ Sorry, a couple more.  I should have included these in the same email ]

Hello Shawn Lin,

This is a semi-automatic email about new static checker warnings.

Commit 926311cf3361 ("mmc: dw_mmc: Remove struct dw_mci_slot") from
Dec 16, 2025, leads to the following Smatch complaint:

drivers/mmc/host/dw_mmc.c:3494 dw_mci_runtime_suspend() warn: variable dereferenced before check 'host' (see line 3489)
drivers/mmc/host/dw_mmc.c:3546 dw_mci_runtime_resume() warn: variable dereferenced before check 'host' (see line 3516)
drivers/mmc/host/dw_mmc.c:3562 dw_mci_runtime_resume() warn: variable dereferenced before check 'host' (see line 3516)

drivers/mmc/host/dw_mmc.c
  3488	
  3489		if (host->use_dma && host->dma_ops->exit)
                    ^^^^^^
The host pointer is dereferenced

  3490			host->dma_ops->exit(host);
  3491	
  3492		clk_disable_unprepare(host->ciu_clk);
  3493	
  3494		if (host &&
                    ^^^^
So this check is too late.

  3495		    (mmc_host_can_gpio_cd(host->mmc) ||
  3496		     !mmc_card_is_removable(host->mmc)))

regards,
dan carpenter

             reply	other threads:[~2025-12-19 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 10:33 Dan Carpenter [this message]
2025-12-19 11:01 ` [bug report] mmc: dw_mmc: Remove struct dw_mci_slot Ulf Hansson
  -- strict thread matches above, loose matches on Subject: below --
2025-12-19  8:17 Dan Carpenter
2025-12-19  8:30 ` Shawn Lin

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=aUUp-x2ex9I_Nd57@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.