diff mbox

[LTSI,3.10] mmc: sdhci-pci: Fix possibility of chip->fixes being null

Message ID 1391516934-13561-1-git-send-email-adrian.hunter@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Adrian Hunter Feb. 4, 2014, 12:28 p.m. UTC
It is possible for chip->fixes to be null.  Check before dereferencing it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <chris@printf.net>
(cherry picked from commit 945be38caa287b177b8c17ffaae7754cab6a658f)
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci-pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Greg KH Feb. 4, 2014, 3:09 p.m. UTC | #1
On Tue, Feb 04, 2014 at 02:28:54PM +0200, Adrian Hunter wrote:
> It is possible for chip->fixes to be null.  Check before dereferencing it.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Chris Ball <chris@printf.net>
> (cherry picked from commit 945be38caa287b177b8c17ffaae7754cab6a658f)
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

As this is going to go into the next 3.10-stable release, there's no
need for it to be added here as well.

thanks,

greg k-h
Greg KH Feb. 4, 2014, 3:10 p.m. UTC | #2
On Tue, Feb 04, 2014 at 04:09:16PM +0100, Greg KH wrote:
> On Tue, Feb 04, 2014 at 02:28:54PM +0200, Adrian Hunter wrote:
> > It is possible for chip->fixes to be null.  Check before dereferencing it.
> > 
> > Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> > Signed-off-by: Chris Ball <chris@printf.net>
> > (cherry picked from commit 945be38caa287b177b8c17ffaae7754cab6a658f)
> > Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> 
> As this is going to go into the next 3.10-stable release, there's no
> need for it to be added here as well.

Well, it should go into 3.10-stable, but doesn't apply, please send a
working backport to the stable@vger.kernel.org mailing list.

thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 33593e7..27ae563 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -1389,7 +1389,8 @@  static struct sdhci_pci_slot *sdhci_pci_probe_slot(
 	 * from runtime suspend.  If it is not there, don't allow runtime PM.
 	 * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure.
 	 */
-	if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio))
+	if (chip->fixes && chip->fixes->own_cd_for_runtime_pm &&
+	    !gpio_is_valid(slot->cd_gpio))
 		chip->allow_runtime_pm = false;
 
 	return slot;