diff options
author | Alan Cox <alan@linux.intel.com> | 2014-12-10 16:06:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-12 14:04:12 +0100 |
commit | 8402641b2dc73748dde81e3513ac61c8436be3cb (patch) | |
tree | 1b07dd8997e0e5c9091da5f877676213cb494810 /drivers/pcmcia/ds.c | |
parent | pcmcia cis: on an out of range CIS read return 0xff, don't just warn (diff) | |
download | linux-8402641b2dc73748dde81e3513ac61c8436be3cb.tar.xz linux-8402641b2dc73748dde81e3513ac61c8436be3cb.zip |
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/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 757119b87146..d3baf0bfca9f 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -667,6 +667,9 @@ static void pcmcia_requery(struct pcmcia_socket *s) { int has_pfc; + if (!(s->state & SOCKET_PRESENT)) + return; + if (s->functions == 0) { pcmcia_card_add(s); return; |