aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/cistpl.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2014-12-10 10:06:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 08:04:12 -0500
commit8402641b2dc73748dde81e3513ac61c8436be3cb (patch)
tree1b07dd8997e0e5c9091da5f877676213cb494810 /drivers/pcmcia/cistpl.c
parentb38a4bd319e615b4eb4be9d8c0d5ddc13113c768 (diff)
pcmcia: Fix requery
The requery logic goes off and attempts to read the CIS of empty slots. In most cases this happens not to do any harm - but not all! Add the missing check and also a WARN() to catch any other offenders. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pcmcia/cistpl.c')
-rw-r--r--drivers/pcmcia/cistpl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 4ff725ca2c74..8b3b49217287 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -1386,7 +1386,7 @@ int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *info)
1386 if (!s) 1386 if (!s)
1387 return -EINVAL; 1387 return -EINVAL;
1388 1388
1389 if (s->functions) { 1389 if (s->functions || !(s->state & SOCKET_PRESENT)) {
1390 WARN_ON(1); 1390 WARN_ON(1);
1391 return -EINVAL; 1391 return -EINVAL;
1392 } 1392 }