mirror of
https://github.com/torvalds/linux
synced 2024-09-20 19:17:24 +00:00
[PATCH] pcmcia: fix ioctl for GET_STATUS and GET_CONFIGURATION_INFO
the p_dev == NULL checks are wrong. the called functions handle a NULL p_dev on their own. w/o this patch output of cardcctl status and cardctl config is broken for cardbus cards or when the slot is empty. Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
7ca7b5c42e
commit
f47ad21492
|
@ -601,13 +601,9 @@ static int ds_ioctl(struct inode * inode, struct file * file,
|
||||||
ret = CS_BAD_ARGS;
|
ret = CS_BAD_ARGS;
|
||||||
else {
|
else {
|
||||||
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
|
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function);
|
||||||
if (p_dev == NULL)
|
|
||||||
ret = CS_BAD_ARGS;
|
|
||||||
else {
|
|
||||||
ret = pccard_get_configuration_info(s, p_dev, &buf->config);
|
ret = pccard_get_configuration_info(s, p_dev, &buf->config);
|
||||||
pcmcia_put_dev(p_dev);
|
pcmcia_put_dev(p_dev);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case DS_GET_FIRST_TUPLE:
|
case DS_GET_FIRST_TUPLE:
|
||||||
mutex_lock(&s->skt_mutex);
|
mutex_lock(&s->skt_mutex);
|
||||||
|
@ -636,13 +632,9 @@ static int ds_ioctl(struct inode * inode, struct file * file,
|
||||||
ret = CS_BAD_ARGS;
|
ret = CS_BAD_ARGS;
|
||||||
else {
|
else {
|
||||||
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
|
struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function);
|
||||||
if (p_dev == NULL)
|
|
||||||
ret = CS_BAD_ARGS;
|
|
||||||
else {
|
|
||||||
ret = pccard_get_status(s, p_dev, &buf->status);
|
ret = pccard_get_status(s, p_dev, &buf->status);
|
||||||
pcmcia_put_dev(p_dev);
|
pcmcia_put_dev(p_dev);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case DS_VALIDATE_CIS:
|
case DS_VALIDATE_CIS:
|
||||||
mutex_lock(&s->skt_mutex);
|
mutex_lock(&s->skt_mutex);
|
||||||
|
|
Loading…
Reference in a new issue