* [PATCH] PCMCIA: missing pcmcia_get_socket() result check
@ 2006-05-25 1:21 Florin Malita
2006-05-29 15:12 ` Dominik Brodowski
0 siblings, 1 reply; 2+ messages in thread
From: Florin Malita @ 2006-05-25 1:21 UTC (permalink / raw)
To: linux-pcmcia; +Cc: akpm, linux-kernel
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>
---
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 48d3b3d..74b3124 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCMCIA: missing pcmcia_get_socket() result check
2006-05-25 1:21 [PATCH] PCMCIA: missing pcmcia_get_socket() result check Florin Malita
@ 2006-05-29 15:12 ` Dominik Brodowski
0 siblings, 0 replies; 2+ messages in thread
From: Dominik Brodowski @ 2006-05-29 15:12 UTC (permalink / raw)
To: Florin Malita; +Cc: linux-pcmcia, akpm, linux-kernel
Hi,
On Wed, May 24, 2006 at 09:21:31PM -0400, Florin Malita wrote:
> The result of pcmcia_get_socket() may be NULL but ds_event() uses it
> without checking.
Applied, thanks.
Dominik
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-30 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-25 1:21 [PATCH] PCMCIA: missing pcmcia_get_socket() result check Florin Malita
2006-05-29 15:12 ` Dominik Brodowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox