public inbox for kernel-janitors@vger.kernel.org
 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

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