Skip to content

Commit

Permalink
[PATCH] pcmcia: missing pcmcia_get_socket() result check
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
fmalita authored and Dominik Brodowski committed Jun 1, 2006
1 parent ba8f5ba commit 1617406
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1617406

Please sign in to comment.