mmc: dw_mmc: rework the code related to cmd/data completion
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
Hi Dan Carpenter,
Quoted 15 lines · Dan Carpenter
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:1339dw_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) { ^^^^^^^^^^
Quoted 7 lines
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.