All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] cifs: fix two compiler warning about uninitialized vars
@ 2011-01-29 12:03 Jeff Layton
       [not found] ` <1296302582-18953-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2011-01-29 12:03 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w

fs/cifs/link.c: In function ‘symlink_hash’:
fs/cifs/link.c:58:3: warning: ‘rc’ may be used uninitialized in this
function [-Wuninitialized]

fs/cifs/smbencrypt.c: In function ‘mdfour’:
fs/cifs/smbencrypt.c:61:3: warning: ‘rc’ may be used uninitialized in this
function [-Wuninitialized]

Cc: Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/link.c       |    3 ++-
 fs/cifs/smbencrypt.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 02cd60a..e8804d3 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -55,8 +55,9 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
 
 	md5 = crypto_alloc_shash("md5", 0, 0);
 	if (IS_ERR(md5)) {
+		rc = PTR_ERR(md5);
 		cERROR(1, "%s: Crypto md5 allocation error %d\n", __func__, rc);
-		return PTR_ERR(md5);
+		return rc;
 	}
 	size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
 	sdescmd5 = kmalloc(size, GFP_KERNEL);
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index b5450e9..b5041c8 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -58,8 +58,9 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
 
 	md4 = crypto_alloc_shash("md4", 0, 0);
 	if (IS_ERR(md4)) {
+		rc = PTR_ERR(md4);
 		cERROR(1, "%s: Crypto md4 allocation error %d\n", __func__, rc);
-		return PTR_ERR(md4);
+		return rc;
 	}
 	size = sizeof(struct shash_desc) + crypto_shash_descsize(md4);
 	sdescmd4 = kmalloc(size, GFP_KERNEL);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] cifs: fix two compiler warning about uninitialized vars
       [not found] ` <1296302582-18953-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2011-01-29 19:42   ` Shirish Pargaonkar
  0 siblings, 0 replies; 2+ messages in thread
From: Shirish Pargaonkar @ 2011-01-29 19:42 UTC (permalink / raw)
  To: Jeff Layton
  Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w, linux-cifs-u79uwXL29TY76Z2rM5mHXA

On Sat, Jan 29, 2011 at 6:03 AM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> fs/cifs/link.c: In function ‘symlink_hash’:
> fs/cifs/link.c:58:3: warning: ‘rc’ may be used uninitialized in this
> function [-Wuninitialized]
>
> fs/cifs/smbencrypt.c: In function ‘mdfour’:
> fs/cifs/smbencrypt.c:61:3: warning: ‘rc’ may be used uninitialized in this
> function [-Wuninitialized]
>
> Cc: Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fs/cifs/link.c       |    3 ++-
>  fs/cifs/smbencrypt.c |    3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/link.c b/fs/cifs/link.c
> index 02cd60a..e8804d3 100644
> --- a/fs/cifs/link.c
> +++ b/fs/cifs/link.c
> @@ -55,8 +55,9 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
>
>        md5 = crypto_alloc_shash("md5", 0, 0);
>        if (IS_ERR(md5)) {
> +               rc = PTR_ERR(md5);
>                cERROR(1, "%s: Crypto md5 allocation error %d\n", __func__, rc);
> -               return PTR_ERR(md5);
> +               return rc;
>        }
>        size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
>        sdescmd5 = kmalloc(size, GFP_KERNEL);
> diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
> index b5450e9..b5041c8 100644
> --- a/fs/cifs/smbencrypt.c
> +++ b/fs/cifs/smbencrypt.c
> @@ -58,8 +58,9 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
>
>        md4 = crypto_alloc_shash("md4", 0, 0);
>        if (IS_ERR(md4)) {
> +               rc = PTR_ERR(md4);
>                cERROR(1, "%s: Crypto md4 allocation error %d\n", __func__, rc);
> -               return PTR_ERR(md4);
> +               return rc;
>        }
>        size = sizeof(struct shash_desc) + crypto_shash_descsize(md4);
>        sdescmd4 = kmalloc(size, GFP_KERNEL);
> --
> 1.7.3.4
>
>

Looks correct.  Missed that.

Reviewed-by: Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-29 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-29 12:03 [PATCH 2/2] cifs: fix two compiler warning about uninitialized vars Jeff Layton
     [not found] ` <1296302582-18953-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-01-29 19:42   ` Shirish Pargaonkar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.