linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: mmc: dw_mmc: rework the code related to cmd/data completion
@ 2013-11-06 16:16 Dan Carpenter
  2013-11-07  3:54 ` Seungwon Jeon
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-06 16:16 UTC (permalink / raw)
  To: tgih.jun; +Cc: linux-mmc

Hello Seungwon Jeon,

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

The patch e352c8131100: "mmc: dw_mmc: rework the code related to 
cmd/data completion" from Aug 31, 2013, leads to the following Smatch 
complaint:

drivers/mmc/host/dw_mmc.c:1339 dw_mci_tasklet_func()
	 error: we previously assumed 'data->stop' could be null (see line 1337)

drivers/mmc/host/dw_mmc.c
  1336				if (!err) {
  1337					if (!data->stop || mrq->sbc) {
                                             ^^^^^^^^^^
New check.

  1338						if (mrq->sbc)
  1339							data->stop->error = 0;
                                                        ^^^^^^^^^^
New unchecked dereference.  Should the check be "if (data->stop)"
instead of "if (mrq->sbc)"?

  1340						dw_mci_request_end(host, mrq);
  1341						goto unlock;

regards,
dan carpenter

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

* RE: mmc: dw_mmc: rework the code related to cmd/data completion
  2013-11-06 16:16 mmc: dw_mmc: rework the code related to cmd/data completion Dan Carpenter
@ 2013-11-07  3:54 ` Seungwon Jeon
  0 siblings, 0 replies; 2+ messages in thread
From: Seungwon Jeon @ 2013-11-07  3:54 UTC (permalink / raw)
  To: 'Dan Carpenter'; +Cc: linux-mmc

Hi Dan Carpenter,

On Thur, November 07, 2013, Dan Carpenter wrote:
> Hello Seungwon Jeon,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch e352c8131100: "mmc: dw_mmc: rework the code related to
> cmd/data completion" from Aug 31, 2013, leads to the following Smatch
> complaint:
> 
> drivers/mmc/host/dw_mmc.c:1339 dw_mci_tasklet_func()
> 	 error: we previously assumed 'data->stop' could be null (see line 1337)
> 
> drivers/mmc/host/dw_mmc.c
>   1336				if (!err) {
>   1337					if (!data->stop || mrq->sbc) {
>                                              ^^^^^^^^^^
> New check.
> 
>   1338						if (mrq->sbc)
>   1339							data->stop->error = 0;
>                                                         ^^^^^^^^^^
> New unchecked dereference.  Should the check be "if (data->stop)"
> instead of "if (mrq->sbc)"?
It assumes that Upper layer sets all together. Actually, it does.
If 'mrq->sbc' is valid, it means that 'data->stop' must be also valid.
But if '&& data->stop' condition is added , it would be certain.
Ok. Thank you for report.

Thanks,
Seungwon Jeon.


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

end of thread, other threads:[~2013-11-07  3:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 16:16 mmc: dw_mmc: rework the code related to cmd/data completion Dan Carpenter
2013-11-07  3:54 ` Seungwon Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).