b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix returned error in batadv_netlink_tp_meter_cancel
Date: Fri, 20 May 2016 20:49:40 +0200	[thread overview]
Message-ID: <1463770180-4030-1-git-send-email-sven@narfation.org> (raw)

From: Simon Wunderlich <sw@simonwunderlich.de>

The BATADV_CMD_TP_METER_CANCEL netlink cmd can for example fail when no
valid soft_iface can be found. This error should not only detected but
also be reported back to the caller.

Fixes: 98d7a766b645 ("batman-adv: throughput meter implementation")
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 net/batman-adv/netlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 56e63ce..c25bbb8 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -350,7 +350,7 @@ batadv_netlink_tp_meter_cancel(struct sk_buff *skb, struct genl_info *info)
 	struct batadv_priv *bat_priv;
 	int ifindex;
 	u8 *dst;
-	int ret;
+	int ret = 0;
 
 	if (!info->attrs[BATADV_ATTR_MESH_IFINDEX])
 		return -EINVAL;
@@ -377,7 +377,7 @@ out:
 	if (soft_iface)
 		dev_put(soft_iface);
 
-	return 0;
+	return ret;
 }
 
 static struct genl_ops batadv_netlink_ops[] = {
-- 
2.8.1


             reply	other threads:[~2016-05-20 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 18:49 Sven Eckelmann [this message]
2016-06-06 16:07 ` [B.A.T.M.A.N.] [PATCH] batman-adv: fix returned error in batadv_netlink_tp_meter_cancel Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463770180-4030-1-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).