public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] isdn: hisax: l3dss1.c:  Fix for possible null pointer dereference
Date: Tue, 20 May 2014 01:24:28 +0400	[thread overview]
Message-ID: <537A768C.8080807@cogentembedded.com> (raw)
In-Reply-To: <1400347101-25476-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

Hello.

On 05/17/2014 09:18 PM, Rickard Strandqvist wrote:

> There is otherwise a risk of a possible null pointer dereference.

> Was largely found by using a static code analysis program called cppcheck.

> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>   drivers/isdn/hisax/l3dss1.c |    8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)

> diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c
> index cda7006..3ea6257 100644
> --- a/drivers/isdn/hisax/l3dss1.c
> +++ b/drivers/isdn/hisax/l3dss1.c
> @@ -2208,8 +2208,12 @@ static int l3dss1_cmd_global(struct PStack *st, isdn_ctrl *ic)
>   				{ free_invoke_id(st, id);
>   					return (-2);
>   				}
> -			pc->prot.dss1.ll_id = ic->parm.dss1_io.ll_id; /* remember id */
> -			pc->prot.dss1.proc = ic->parm.dss1_io.proc; /* and procedure */
> +
> +			if (pc)
> +			{

    { sould be on the same line as *if*.

> +				pc->prot.dss1.ll_id = ic->parm.dss1_io.ll_id; /* remember id */
> +				pc->prot.dss1.proc = ic->parm.dss1_io.proc; /* and procedure */
> +			}

WBR, Sergei


  parent reply	other threads:[~2014-05-19 21:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17 17:18 [PATCH] isdn: hisax: l3dss1.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-05-19  1:12 ` David Miller
2014-05-19 21:18   ` Rickard Strandqvist
2014-05-19 21:24 ` Sergei Shtylyov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-05-19 21:24 Rickard Strandqvist
2014-05-19 21:26 ` Sergei Shtylyov
2014-05-19 21:56   ` Rickard Strandqvist
2014-05-20 12:23     ` Sergei Shtylyov

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=537A768C.8080807@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=isdn@linux-pingi.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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