PCMCIA: missing pcmcia_get_socket() result check
PATCH 1/1 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 <[email protected]>
---
drivers/pcmcia/ds.c +6 -0
@@ -1143,6 +1143,12 @@ static int ds_event(struct pcmcia_socket {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);
Hi,
Quoted 2 lines · Florin Malita
The result of
pcmcia_get_socket()may be NULL butds_event()uses it without checking.
Applied, thanks.
Dominik