lkml.org 
[lkml]   [2010]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ISDN cmx: Avoid potential NULL deref in dsp_cmx_send_member() and shrink code size.
From
From: Jesper Juhl <jj@chaosbits.net>
Date: Sat, 18 Dec 2010 23:33:40 +0100 (CET)

> Hi there,
>
> In drivers/isdn/mISDN/dsp_cmx.c::dsp_cmx_send_member() we currently have
> this code:
>
> if (dsp->conf && dsp->conf->software && dsp->conf->hardware)
> tx_data_only = 1;
> if (dsp->conf->software && dsp->echo.hardware)
> tx_data_only = 1;
>
> The first line implies that 'dsp->conf' may be NULL. If it is, then the
> third line will dereference a NULL pointer.
>
> This patch reworks the code so that we avoid the potential NULL deref.
> It also has the added benefit that the object file size shrinks a bit.
>
> before:
> text data bss dec hex filename
> 18840 112 5784 24736 60a0 drivers/isdn/mISDN/dsp_cmx.o
> after:
> text data bss dec hex filename
> 18816 112 5776 24704 6080 drivers/isdn/mISDN/dsp_cmx.o
>
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied.


\
 
 \ /
  Last update: 2010-12-31 20:21    [W:0.035 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site