From 0b23810d8c37a707abb076394c4bca76362cf06d Mon Sep 17 00:00:00 2001 From: Veaceslav Falico Date: Mon, 6 Jan 2014 11:54:40 +0100 Subject: [PATCH] bonding: fix kstrtou8() return value verification in num_peer_notif It returns 0 in case of success, !0 error otherwise. Fix the improper error verification. Fixes: 2c9839c143bbc ("bonding: add num_grat_arp attribute netlink support") CC: sfeldma@cumulusnetworks.com CC: Jay Vosburgh CC: Andy Gospodarek Signed-off-by: Veaceslav Falico Acked-by: Scott Feldman Signed-off-by: David S. Miller --- drivers/net/bonding/bond_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 9a1ea4a171c7..011f163c2c67 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -776,7 +776,7 @@ static ssize_t bonding_store_num_peer_notif(struct device *d, int ret; ret = kstrtou8(buf, 10, &new_value); - if (!ret) { + if (ret) { pr_err("%s: invalid value %s specified.\n", bond->dev->name, buf); return ret; -- 2.39.5