Commit de1bf52a authored by Armin Schindler's avatar Armin Schindler Committed by Linus Torvalds

[PATCH] ISDN Eicon driver: NULL pointer check inside spinlock

   Check for valid application pointer inside api spinlock
   in diva_send_message().
parent 6e7bbc73
/* $Id: capifunc.c,v 1.60 2004/03/22 16:28:27 armin Exp $ /* $Id: capifunc.c,v 1.61 2004/03/26 19:48:48 armin Exp $
* *
* ISDN interface module for Eicon active cards DIVA. * ISDN interface module for Eicon active cards DIVA.
* CAPI Interface common functions * CAPI Interface common functions
...@@ -893,7 +893,10 @@ static u16 diva_send_message(struct capi_ctr *ctrl, ...@@ -893,7 +893,10 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
return CAPI_REGOSRESOURCEERR; return CAPI_REGOSRESOURCEERR;
} }
diva_os_enter_spin_lock(&api_lock, &old_irql, "send message");
if (!this->Id) { if (!this->Id) {
diva_os_leave_spin_lock(&api_lock, &old_irql, "send message");
return CAPI_ILLAPPNR; return CAPI_ILLAPPNR;
} }
...@@ -901,8 +904,6 @@ static u16 diva_send_message(struct capi_ctr *ctrl, ...@@ -901,8 +904,6 @@ static u16 diva_send_message(struct capi_ctr *ctrl,
msg->header.controller = ControllerMap[card->Id] msg->header.controller = ControllerMap[card->Id]
| (msg->header.controller & 0x80); /* preserve external controller bit */ | (msg->header.controller & 0x80); /* preserve external controller bit */
diva_os_enter_spin_lock(&api_lock, &old_irql, "send message");
switch (command) { switch (command) {
default: default:
xlog("\x00\x02", msg, 0x80, clength); xlog("\x00\x02", msg, 0x80, clength);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment