netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jj@chaosbits.net
Cc: isdn@linux-pingi.de, julia@diku.dk, tj@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	jolly@eversberg.eu
Subject: Re: [PATCH] ISDN cmx: Avoid potential NULL deref in dsp_cmx_send_member() and shrink code size.
Date: Fri, 31 Dec 2010 11:19:15 -0800 (PST)	[thread overview]
Message-ID: <20101231.111915.179940096.davem@davemloft.net> (raw)
In-Reply-To: <alpine.LNX.2.00.1012182322330.17400@swampdragon.chaosbits.net>

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.

      reply	other threads:[~2010-12-31 19:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 22:33 [PATCH] ISDN cmx: Avoid potential NULL deref in dsp_cmx_send_member() and shrink code size Jesper Juhl
2010-12-31 19:19 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101231.111915.179940096.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=isdn@linux-pingi.de \
    --cc=jj@chaosbits.net \
    --cc=jolly@eversberg.eu \
    --cc=julia@diku.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).