lkml.org 
[lkml]   [2014]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] isdn: hisax: l3dss1.c: Fix for possible null pointer dereference
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



\
 
 \ /
  Last update: 2014-05-20 11:21    [W:0.073 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site