Skip to contentSkip to conversation

cifs: cifs_convert_address() returns zero on error

PATCH In review Dan Carpenter 2 participants 2 messages Oct 25, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: cifs_convert_address() returns zero on error

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.

fs/cifs/connect.c +1 -1
index 7e73176..ad6a4ea 100644
@@ -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);
#1 lore raw
Quoted 21 lines · On Mon, 25 Oct 2010 07:02:56 +0200 Dan Carpenter <[email protected]> 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.

fs/cifs/connect.c +1 -2
index 7e73176..ad6a4ea 100644
@@ -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);
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Good catch. Looks right to me.

Reviewed-by:

Signature · 1 line
Jeff Layton <[email protected]>