Skip to content

Commit

Permalink
[PATCH] pcmcia: fix ioctl for GET_STATUS and GET_CONFIGURATION_INFO
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Ritz authored and Linus Torvalds committed Jul 31, 2006
1 parent 7ca7b5c commit f47ad21
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions drivers/pcmcia/pcmcia_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
ret = CS_BAD_ARGS;
else {
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);
pcmcia_put_dev(p_dev);
}
ret = pccard_get_configuration_info(s, p_dev, &buf->config);
pcmcia_put_dev(p_dev);
}
break;
case DS_GET_FIRST_TUPLE:
Expand Down Expand Up @@ -636,12 +632,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
ret = CS_BAD_ARGS;
else {
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);
pcmcia_put_dev(p_dev);
}
ret = pccard_get_status(s, p_dev, &buf->status);
pcmcia_put_dev(p_dev);
}
break;
case DS_VALIDATE_CIS:
Expand Down

0 comments on commit f47ad21

Please sign in to comment.