kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] cifs: cifs_convert_address() returns zero on error
@ 2010-10-25  5:02 Dan Carpenter
  2010-10-25 15:31 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-10-25  5:02 UTC (permalink / raw)
  To: Steve French
  Cc: Jeff Layton, Suresh Jayaraman, Shirish Pargaonkar,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

The cifs_convert_address() returns zero on error but this caller is
testing for negative returns.

Btw. "i" is unsigned here, so it's never negative.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 7e73176..ad6a4ea 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1064,7 +1064,7 @@ cifs_parse_mount_options(char *options, const char *devname,
 			}
 			i = cifs_convert_address((struct sockaddr *)&vol->srcaddr,
 						 value, strlen(value));
-			if (i < 0) {
+			if (i = 0) {
 				printk(KERN_WARNING "CIFS:  Could not parse"
 				       " srcaddr: %s\n",
 				       value);

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

* Re: [patch] cifs: cifs_convert_address() returns zero on error
  2010-10-25  5:02 [patch] cifs: cifs_convert_address() returns zero on error Dan Carpenter
@ 2010-10-25 15:31 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2010-10-25 15:31 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steve French, Suresh Jayaraman, Shirish Pargaonkar,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

On Mon, 25 Oct 2010 07:02:56 +0200
Dan Carpenter <error27@gmail.com> wrote:

> The cifs_convert_address() returns zero on error but this caller is
> testing for negative returns.
> 
> Btw. "i" is unsigned here, so it's never negative.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 7e73176..ad6a4ea 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -1064,7 +1064,7 @@ cifs_parse_mount_options(char *options, const char *devname,
>  			}
>  			i = cifs_convert_address((struct sockaddr *)&vol->srcaddr,
>  						 value, strlen(value));
> -			if (i < 0) {
> +			if (i = 0) {
>  				printk(KERN_WARNING "CIFS:  Could not parse"
>  				       " srcaddr: %s\n",
>  				       value);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Good catch. Looks right to me.

Reviewed-by:
-- 
Jeff Layton <jlayton@samba.org>

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

end of thread, other threads:[~2010-10-25 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25  5:02 [patch] cifs: cifs_convert_address() returns zero on error Dan Carpenter
2010-10-25 15:31 ` Jeff Layton

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).