Skip to contentSkip to conversation

bonding: fix return value of bonding_store_slaves_active()

PATCH In review Jiri Pirko 3 participants 6 messages Jan 25, 2011

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 bonding: fix return value of bonding_store_slaves_active()

count is incorrectly returned even in case of fail. Return ret instead.

drivers/net/bonding/bond_sysfs.c +1 -1
index 8fd0174..f33155f 100644
@@ -1595,7 +1595,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
 		}
 	}
 out:
-	return count;
+	return ret;
 }
 static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,
 		   bonding_show_slaves_active, bonding_store_slaves_active);
#1 lore raw
Quoted 3 lines · Jiri Pirko

count is incorrectly returned even in case of fail. Return ret instead.

It looks like bonding_store_carrier has the same problem, could
you fix it up too and resubmit?

	-J
Quoted 13 lines
drivers/net/bonding/bond_sysfs.c +0 -0
index 8fd0174..f33155f 100644
@@ -1595,7 +1595,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
 		}
 	}

out:

drivers/net/bonding/bond_sysfs.c +1 -1
-	return count;
+	return ret;

}
static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,

		   bonding_show_slaves_active, bonding_store_slaves_active);
author
#2 lore raw
Quoted 8 lines · Tue, Jan 25, 2011 at 08:22:50PM CET, [email protected] wrote:
Quoted 3 lines · Jiri Pirko

count is incorrectly returned even in case of fail. Return ret instead.

It looks like bonding_store_carrier has the same problem, could
you fix it up too and resubmit?

you are right, I missed that. Will resend.

Thanks.

Jirka

Quoted 18 lines
	-J
Quoted 13 lines
drivers/net/bonding/bond_sysfs.c +0 -0
index 8fd0174..f33155f 100644
@@ -1595,7 +1595,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
 		}
 	}

out:

drivers/net/bonding/bond_sysfs.c +1 -1
-	return count;
+	return ret;

}
static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,

		   bonding_show_slaves_active, bonding_store_slaves_active);
author
#3 lore raw

PATCH 1/1 bonding: fix return value of couple of store functions

In reply to Jay Vosburgh

count is incorrectly returned even in case of fail. Return ret instead.

drivers/net/bonding/bond_sysfs.c +2 -2
index 8fd0174..72bb0f6 100644
@@ -1198,7 +1198,7 @@ static ssize_t bonding_store_carrier(struct device *d,
 			bond->dev->name, new_value);
 	}
 out:
-	return count;
+	return ret;
 }
 static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR,
 		   bonding_show_carrier, bonding_store_carrier);
@@ -1595,7 +1595,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
 		}
 	}
 out:
-	return count;
+	return ret;
 }
 static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,
 		   bonding_show_slaves_active, bonding_store_slaves_active);
#4 lore raw

Re: [PATCH net-next-2.6] bonding: fix return value of couple of store functions

Quoted 3 lines · Jiri Pirko

count is incorrectly returned even in case of fail. Return ret instead.

Quoted 22 lines
drivers/net/bonding/bond_sysfs.c +0 -0
index 8fd0174..72bb0f6 100644
@@ -1198,7 +1198,7 @@ static ssize_t bonding_store_carrier(struct device *d,
 			bond->dev->name, new_value);
 	}

out:

drivers/net/bonding/bond_sysfs.c +1 -1
-	return count;
+	return ret;

}
static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR,

		   bonding_show_carrier, bonding_store_carrier);
drivers/net/bonding/bond_sysfs.c +0 -0
@@ -1595,7 +1595,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
 		}
 	}

out:

drivers/net/bonding/bond_sysfs.c +1 -1
-	return count;
+	return ret;

}
static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR,

		   bonding_show_slaves_active, bonding_store_slaves_active);