public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kyungmin Park <kyungmin.park@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-mmc@vger.kernel.org
Subject: asdf
Date: Tue, 6 Dec 2011 11:08:59 +0300	[thread overview]
Message-ID: <20111206080842.GA10021@elgon.mountain> (raw)

There is a new gcc warning in this function:

drivers/mmc/card/block.c:836:18: warning: ‘arg’ may be used uninitialized in this function [-Wuninitialized]

   810          /* The sanitize operation is supported at v4.5 only */
   811          if (mmc_can_sanitize(card)) {
   812                  err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
   813                                  EXT_CSD_SANITIZE_START, 1, 0);

1) arg is uninitialized here.  mmc_switch() can return -EIO.

   814                  goto out;
   815          }
   816  
   817          from = blk_rq_pos(req);
   818          nr = blk_rq_sectors(req);
   819  
   820          if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
   821                  arg = MMC_SECURE_TRIM1_ARG;
   822          else
   823                  arg = MMC_SECURE_ERASE_ARG;
   824  retry:
   825          if (card->quirks & MMC_QUIRK_INAND_CMD38) {
   826                  err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
   827                                   INAND_CMD38_ARG_EXT_CSD,
   828                                   arg == MMC_SECURE_TRIM1_ARG ?
                                         ^^^

3) uninitialized.

   829                                   INAND_CMD38_ARG_SECTRIM1 :
   830                                   INAND_CMD38_ARG_SECERASE,
   831                                   0);
   832                  if (err)
   833                          goto out;
   834          }
   835          err = mmc_erase(card, from, nr, arg);
   836          if (!err && arg == MMC_SECURE_TRIM1_ARG) {
   837                  if (card->quirks & MMC_QUIRK_INAND_CMD38) {
   838                          err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
   839                                           INAND_CMD38_ARG_EXT_CSD,
   840                                           INAND_CMD38_ARG_SECTRIM2,
   841                                           0);
   842                          if (err)
   843                                  goto out;
   844                  }
   845                  err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG);
   846          }
   847  out:
   848          if (err == -EIO && !mmc_blk_reset(md, card->host, type))
   849                  goto retry;

2) We could maybe hit the goto retry here if the reset works.

regards,
dan carpenter

             reply	other threads:[~2011-12-06  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06  8:08 Dan Carpenter [this message]
2011-12-06  8:15 ` uninitialized variable in mmc_blk_issue_secdiscard_rq() Dan Carpenter
2011-12-06  8:48 ` asdf Kyungmin Park

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=20111206080842.GA10021@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=adrian.hunter@intel.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mmc@vger.kernel.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