Re: [PATCH] cifssmb: [FIX] warning: ‘pdata’ may be used uninitialized

Steve French smfrench at gmail.com
Sun Mar 13 12:35:08 MDT 2011


This does look a problem with the compiler.  Which compiler version?

As you noted, pdata is either initialized or we return rc!=0 and don't use it.

On Sun, Mar 13, 2011 at 11:23 AM, Richard Genoud
<richard.genoud at gmail.com> wrote:
> This suppress the warning, as far as there's no way pdata is
> uninitialized, because validate_ntransact() will initialize pdata or
> return rc != 0. In this case (goto qsec_out), pdata won't be used.
>
> Signed-off-by: Richard Genoud <richard.genoud at gmail.com>
> ---
>  fs/cifs/cifssmb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 904aa47..efa3f8e 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -3138,7 +3138,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
>                __u32 parm_len;
>                __u32 acl_len;
>                struct smb_com_ntransact_rsp *pSMBr;
> -               char *pdata;
> +               char *pdata = NULL;
>
>  /* validate_nttransact */
>                rc = validate_ntransact(iov[0].iov_base, (char **)&parm,
> --
> 1.7.1
>
>



-- 
Thanks,

Steve


More information about the samba-technical mailing list