summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Ritz <daniel.ritz-ml@swissonline.ch>2006-07-30 03:03:47 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-31 13:28:41 -0700
commitf47ad214926b1dbcc591fd71562e36f1529936b5 (patch)
treeca96cdcec260e0d8f3b83ae44eec4a3c701dc3a3 /drivers
parent7ca7b5c42e783b74a57387418bfcfea072fc46d6 (diff)
[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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 738b1ef595a..9ad18e62658 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -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:
@@ -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: