Skip to contentSkip to conversation

mmc: parse new binding for eMMC fixed driver type

bug report Dan Carpenter 2 participants 2 messages Nov 30, 2017 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hello Wolfram Sang,

The patch 6186d06c519e: "mmc: parse new binding for eMMC fixed driver type" from Oct 15, 2017, leads to the following static checker warning:

	drivers/mmc/core/mmc.c:1309 mmc_select_driver_type()
	error: uninitialized symbol 'drv_type'.

drivers/mmc/core/mmc.c
1291 static void mmc_select_driver_type(struct mmc_card *card) 1292 {
1293 int card_drv_type, drive_strength, drv_type;
1294 int fixed_drv_type = card->host->fixed_drv_type;
1295
1296 card_drv_type = card->ext_csd.raw_driver_strength |
1297 mmc_driver_type_mask(0);
1298
1299 if (fixed_drv_type >= 0)
1300 drive_strength = card_drv_type & mmc_driver_type_mask(fixed_drv_type)
1301 ? fixed_drv_type : 0;

drv_type is not initialized if fixed_drv_type is greater than zero.

1302 else
1303 drive_strength = mmc_select_drive_strength(card,
1304 card->ext_csd.hs200_max_dtr,
1305 card_drv_type, &drv_type);
1306
1307 card->drive_strength = drive_strength;
1308
1309 if (drv_type)

                    ^^^^^^^^
  1310                  mmc_set_driver_type(card->host, drv_type);
  1311  }

regards,
dan carpenter

#1 lore raw
Quoted 7 lines

The patch 6186d06c519e: "mmc: parse new binding for eMMC fixed driver type" from Oct 15, 2017, leads to the following static checker warning:

	drivers/mmc/core/mmc.c:1309 mmc_select_driver_type()
	error: uninitialized symbol 'drv_type'.

Thanks for the report!

Correct. The code used to be in mmc_select_drive_strength() which already has:

	*drv_type = 0;

After the code move, this was missed. I'll send a fix today!

Thanks again!

Wolfram