summary refs log tree commit diff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-07-14 17:05:50 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2016-07-18 11:50:40 +0200
commitb3802db5eb72d2a96f4aa4ff0abb937033df2acf (patch)
tree913e1b312515180d010d34eb16d3628fb29a0fca /drivers/mailbox
parentf68381a70bb2b26c31b13fdaf67c778f92fd32b4 (diff)
downloadlinux-b3802db5eb72d2a96f4aa4ff0abb937033df2acf.tar.gz
mmc: pxamci: fix potential oops
As reported by Dan in his report in [1], there is a potential NULL
pointer derefence if these conditions are met :
 - there is no platform_data provided, ie. host->pdata = NULL

Fix this by only using the platform data ro_invert when a gpio for
read-only is provided by the platform data.

This doesn't appear yet as every pxa board provides a platform_data, and
calls pxa_set_mci_info() with a non NULL pointer.

[1] [bug report] mmc: pxamci: fix card detect with slot-gpio API.
The commit fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio
API") from Sep 26, 2015, leads to the following static checker warning:

	drivers/mmc/host/pxamci.c:809 pxamci_probe()
	warn: variable dereferenced before check 'host->pdata' (see line 798)

Fixes: fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio API")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mailbox')
0 files changed, 0 insertions, 0 deletions