summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2009-06-07 09:09:24 +0000
committerDavid S. Miller <davem@davemloft.net>2009-06-08 00:45:51 -0700
commit7d31acda9f8eaa27e2fd232712f7e1f3e9a79bdb (patch)
tree977fbd3081ba483b01c37dd1913ba4c9a0a95117
parent4793d15b25821003486bb11b54eaf2f3130ecacd (diff)
downloadop-kernel-dev-7d31acda9f8eaa27e2fd232712f7e1f3e9a79bdb.zip
op-kernel-dev-7d31acda9f8eaa27e2fd232712f7e1f3e9a79bdb.tar.gz
isdn: prevent NULL ptr Oops in capi_cmsg2str()
The dereferencing of the private pointer cmsg->m in capi_cmsg2str() may cause an Oops in case of an error, which is particularly inconvenient as that function is typically used to format an error message. Add a NULL pointer check to avoid this. Impact: error handling improvement Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/capi/capiutil.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c
index c7c2902..16f2e46 100644
--- a/drivers/isdn/capi/capiutil.c
+++ b/drivers/isdn/capi/capiutil.c
@@ -989,6 +989,8 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg)
{
_cdebbuf *cdb;
+ if (!cmsg->m)
+ return NULL; /* no message */
cdb = cdebbuf_alloc();
if (!cdb)
return NULL;
OpenPOWER on IntegriCloud