All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] mmc: parse new binding for eMMC fixed driver type
@ 2017-11-30  9:20 Dan Carpenter
  2017-11-30 14:39 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-11-30  9:20 UTC (permalink / raw)
  To: wsa+renesas; +Cc: linux-mmc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] mmc: parse new binding for eMMC fixed driver type
  2017-11-30  9:20 [bug report] mmc: parse new binding for eMMC fixed driver type Dan Carpenter
@ 2017-11-30 14:39 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2017-11-30 14:39 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: wsa+renesas, linux-mmc

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]


> 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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-30 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30  9:20 [bug report] mmc: parse new binding for eMMC fixed driver type Dan Carpenter
2017-11-30 14:39 ` Wolfram Sang

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.