public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jglauber@cavium.com
Cc: linux-mmc@vger.kernel.org
Subject: [bug report] mmc: cavium: Add core MMC driver for Cavium SOCs
Date: Wed, 12 Apr 2017 23:31:50 +0300	[thread overview]
Message-ID: <20170412203150.GB3915@mwanda> (raw)

Hello Jan Glauber,

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

The patch 8047c753f3d3: "mmc: cavium: Add core MMC driver for Cavium 
SOCs" from Mar 30, 2017, leads to the following Smatch complaint:

drivers/mmc/host/cavium.c:803 cvm_mmc_request()
	 error: we previously assumed 'cmd->data' could be null (see line 782)

drivers/mmc/host/cavium.c
   781	
   782		if (cmd->data) {
                    ^^^^^^^^^
Check.

   783			if (cmd->data->flags & MMC_DATA_READ)
   784				do_read_request(host, mrq);
   785			else
   786				do_write_request(host, mrq);
   787	
   788			if (cmd->data->timeout_ns)
   789				set_wdog(slot, cmd->data->timeout_ns);
   790		} else
   791			set_wdog(slot, 0);
   792	
   793		host->dma_active = false;
   794		host->int_enable(host, MIO_EMM_INT_CMD_DONE | MIO_EMM_INT_CMD_ERR);
   795	
   796		emm_cmd = FIELD_PREP(MIO_EMM_CMD_VAL, 1) |
   797			  FIELD_PREP(MIO_EMM_CMD_CTYPE_XOR, mods.ctype_xor) |
   798			  FIELD_PREP(MIO_EMM_CMD_RTYPE_XOR, mods.rtype_xor) |
   799			  FIELD_PREP(MIO_EMM_CMD_IDX, cmd->opcode) |
   800			  FIELD_PREP(MIO_EMM_CMD_ARG, cmd->arg);
   801		set_bus_id(&emm_cmd, slot->bus_id);
   802		if (mmc_cmd_type(cmd) == MMC_CMD_ADTC)
   803			emm_cmd |= FIELD_PREP(MIO_EMM_CMD_OFFSET,
   804					64 - ((cmd->data->blocks * cmd->data->blksz) / 8));
                                               ^^^^^^^^^^^         ^^^^^^^^^^^
Unchecked dereferences.  These are maybe false postives if == MMC_CMD_ADTC
implies data is non-NULL.  In that case, don't worry about it, this is
a one time email.

   805	

regards,
dan carpenter

             reply	other threads:[~2017-04-12 20:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12 20:31 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-12 19:54 [bug report] mmc: cavium: Add core MMC driver for Cavium SOCs Dan Carpenter

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=20170412203150.GB3915@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jglauber@cavium.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