From patchwork Fri May 20 18:49:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16262 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 3EACA81689; Fri, 20 May 2016 20:49:46 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=IRfeJsDu; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 9044B81686 for ; Fri, 20 May 2016 20:49:44 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C09EFD0000000000002E16.dip0.t-ipconnect.de [IPv6:2003:c5:93c0:9efd::2e16]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id D24081100E7; Fri, 20 May 2016 20:49:43 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1463770184; bh=7v5kIGaFRRJ/7zlkNcLTcG+2hK4UOLOGxKp/yodo118=; h=From:To:Cc:Subject:Date:From; b=IRfeJsDuLfrgmseG/Rjp7Qc2mORSQyRoD/r2+IKPpizRxYGo8bROy+w3bnwsnZcSg Aqy9n4lYnFK7EuFIGK/7g6CiScgOThAwoWDbXk2X4KVOeIpT7aFrB78ReKJwXJCzwT ggLTTT4Gs23JXJZ4VpwL2RIH+LfAw63kX7QVjE+o= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 20 May 2016 20:49:40 +0200 Message-Id: <1463770180-4030-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix returned error in batadv_netlink_tp_meter_cancel X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: Simon Wunderlich 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 Signed-off-by: Sven Eckelmann --- 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[] = {