summaryrefslogtreecommitdiff
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorFlorin Malita <fmalita@gmail.com>2006-05-24 21:21:31 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2006-06-02 00:56:17 +0200
commit1617406a763870a84ffe6bba3659f30f96ac4a61 (patch)
tree8cb1b005e2e0769f8fdefe05eda13c44aad61c36 /drivers/pcmcia
parentba8f5baba79da8eb502f8534c3a8ecb64aceb790 (diff)
[PATCH] pcmcia: missing pcmcia_get_socket() result check
The result of pcmcia_get_socket() may be NULL but ds_event() uses it without checking. Coverity CID: 436. Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/ds.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 48d3b3d30c2..74b3124e824 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1143,6 +1143,12 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
{
struct pcmcia_socket *s = pcmcia_get_socket(skt);
+ if (!s) {
+ printk(KERN_ERR "PCMCIA obtaining reference to socket %p " \
+ "failed, event 0x%x lost!\n", skt, event);
+ return -ENODEV;
+ }
+
ds_dbg(1, "ds_event(0x%06x, %d, 0x%p)\n",
event, priority, skt);