[bug report] mmc: core: Prepare to support SD UHS-II cards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ulf Hansson,

Commit cda235518e91 ("mmc: core: Prepare to support SD UHS-II cards")
from Sep 13, 2024 (linux-next), leads to the following Smatch static
checker warning:

	drivers/mmc/core/sd_uhs2.c:138 sd_uhs2_init_card()
	error: uninitialized symbol 'node_id'.

drivers/mmc/core/sd_uhs2.c
    120 static int sd_uhs2_init_card(struct mmc_host *host)
    121 {
    122         struct mmc_card *card;
    123         u32 node_id;
    124         int err;
    125 
    126         err = sd_uhs2_dev_init(host);
    127         if (err)
    128                 return err;
    129 
    130         err = sd_uhs2_enum(host, &node_id);
    131         if (err)
    132                 return err;
    133 
    134         card = mmc_alloc_card(host, &sd_type);
    135         if (IS_ERR(card))
    136                 return PTR_ERR(card);
    137 
--> 138         card->uhs2_config.node_id = node_id;

The sd_uhs2_enum() function is a dummy function so this is kind of intentional
but I just checked and it causes a build error in Clang.  I'm surprised
Nathan hasn't complained yet.

    139         card->type = MMC_TYPE_SD;
    140 
    141         err = sd_uhs2_config_read(host, card);
    142         if (err)
    143                 goto err;
    144 
    145         err = sd_uhs2_config_write(host, card);
    146         if (err)
    147                 goto err;
    148 
    149         host->card = card;
    150         return 0;
    151 
    152 err:
    153         mmc_remove_card(card);
    154         return err;
    155 }

regards,
dan carpenter




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux