Commit graph

3 commits

Author SHA1 Message Date
Gustavo A. R. Silva
c00a231ba0 mmc: bcm2835: fix potential null pointer dereferences
Null check at line 1165: if (mrq->cmd), implies that mrq->cmd might
be NULL.
Add null checks before dereferencing pointer mrq->cmd in order to avoid
any potential NULL pointer dereference.

Addresses-Coverity-ID: 1408740
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-06-20 10:30:31 +02:00
Stefan Wahren
bf3240bada mmc: bcm2835: Fix possible NULL ptr dereference in bcm2835_request
This fixes a NULL pointer dereference in case of a MMC request with a
set block count command and no data.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-04-24 21:41:53 +02:00
Eric Anholt
660fc733bd mmc: bcm2835: Add new driver for the sdhost controller.
The 2835 has two SD controllers: The Arasan sdhci controller (supported
by the iproc driver) and a custom sdhost controller.  This patch adds a
driver for the latter.

The sdhci controller supports both sdcard and sdio.  The sdhost
controller supports the sdcard only, but has better performance.  Also
note that the rpi3 has sdio wifi, so driving the sdcard with the sdhost
controller allows to use the sdhci controller for wifi support.

The configuration is done by devicetree via pin muxing.  Both SD
controller are available on the same pins (2 pin groups = pin 22 to 27 +
pin 48 to 53).  So it's possible to use both SD controllers at the same
time with different pin groups.

The code was originally written by Phil Elwell in the downstream
Rasbperry Pi tree.   In preparation for the upstream merge it was
cleaned up and the code base was moderized by Eric Anholt, Stefan
Wahren and Gerd Hoffmann.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-04-24 21:41:25 +02:00