From patchwork Mon Dec 24 17:49:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Pakki X-Patchwork-Id: 17718 X-Patchwork-Delegate: sw@simonwunderlich.de 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 5A0248134F; Mon, 24 Dec 2018 19:39:29 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=umn.edu header.i=@umn.edu header.b="cMfu2SGG"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=134.84.196.206; helo=mta-p6.oit.umn.edu; envelope-from=pakki001@umn.edu; receiver= X-Greylist: delayed 552 seconds by postgrey-1.36 at open-mesh.org; Mon, 24 Dec 2018 18:58:52 CET Received: from mta-p6.oit.umn.edu (mta-p6.oit.umn.edu [134.84.196.206]) by open-mesh.org (Postfix) with ESMTPS id 086B78072F for ; Mon, 24 Dec 2018 18:58:51 +0100 (CET) Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id E1804CA8 for ; Mon, 24 Dec 2018 17:49:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IO0dYBsaNq-a for ; Mon, 24 Dec 2018 11:49:37 -0600 (CST) Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id BB55DC37 for ; Mon, 24 Dec 2018 11:49:37 -0600 (CST) Received: by mail-io1-f69.google.com with SMTP id t13so8362551ioi.3 for ; Mon, 24 Dec 2018 09:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=2Ao+gJbWRf5uI9O3Ydh6HJbnkX7WsBud85/G+qeySFc=; b=cMfu2SGG1FjYVLehH/K6zaPyFaSLQG+GueW22MwaNqcUyhONdRMdiE6tH+RRx1r7Mp p2QvxWwZuGcI/a9NnJdB1aMC2C4V+swE7AIwXFOEjQLd2KCqGFKpx28BLq2VO7t8UmE1 huZOmutrFwgcd5NCgBkEmTkI02bfMZ27MXMZrbtZnVYs1CGHWuzL4Er6xhfxGgmfFQNg Oahsf5UigCkTN3MDn0X6xb4lKXbrBoIKX2ld/fwHJZQsNOjUWZnkaPHmHYojg+qd4BxO 3JmZqEvw6t+UAblku/LKaur9lP+J1te3vuqbx1in80ZfDqz+/sxro8BQGeKElGuSwNEe Twug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2Ao+gJbWRf5uI9O3Ydh6HJbnkX7WsBud85/G+qeySFc=; b=qqsWBYHh2Ftx55W3XEjAW6z6ZU9LnEdH3KPxxvQ8ZrgKj0MH/wNrUNEJ1JHuLsi4nk IIXc94Sf7W7dkrkb2Te8Vy8ce9A+cdu+A2c4vj2fgoa1cygZGH8zBHTQdk9ro3kZQzFB OJtZNRw8RHVI8zwXPNInG16Qx/6I31DnoKZE/aS0c2NS3RNi2m/8A4FUAJ+ppUXpMvKm jPVze0LzS2bu3siQpckbWMBn4M8ZCw2zCoBZmv00oMWtWOo05LX8JIWwjJsug1MJm/0F lvDT4d9juSFY4kIC4ZNjO7zKmejiomTKIM4W8R2/R9LHgUhCmyZknxCVN4YHtFKGq8nW LfrA== X-Gm-Message-State: AJcUukfo54p8rY5YUUx2HaBdQbXIw47+NCm1M6/8HhRC0OuP/daqwUyX mVYUy//6uRw13jKh+A3f83d/C/cdqJTTs1JCmWWkrdrVUEpMPdxs4OtFHloOTqz41iKCNApP2hQ 8jiV6Mseu93zxCGmz379JB8G+5dGETSUB X-Received: by 2002:a24:bd0e:: with SMTP id x14mr8781545ite.123.1545673777297; Mon, 24 Dec 2018 09:49:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WQ1NalqcExE04UEJQucz4zQ7nbL2L6/4EOVdP/yEAyxBM4vrGcNqDC6FCXa/0nGbvbM9iYYg== X-Received: by 2002:a24:bd0e:: with SMTP id x14mr8781531ite.123.1545673777055; Mon, 24 Dec 2018 09:49:37 -0800 (PST) Received: from cs-u-syssec1.cs.umn.edu (cs-u-syssec1.cs.umn.edu. [134.84.121.78]) by smtp.gmail.com with ESMTPSA id h16sm11440229ith.25.2018.12.24.09.49.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Dec 2018 09:49:36 -0800 (PST) From: Aditya Pakki To: pakki001@umn.edu Date: Mon, 24 Dec 2018 11:49:26 -0600 Message-Id: <20181224174926.20321-1-pakki001@umn.edu> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Mon, 24 Dec 2018 19:39:28 +0100 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv/main: Fix check on return value of rtnl_link_register X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 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 Cc: Marek Lindner , kjlu@umn.edu, b.a.t.m.a.n@lists.open-mesh.org, Antonio Quartulli , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" rtnl_link_register() may fail and can impact registering the device. The fix checks the return value and pushes the error upstream. Signed-off-by: Aditya Pakki --- net/batman-adv/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 69c0d85bceb3..e0007f242823 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@ -109,7 +109,10 @@ static int __init batadv_init(void) batadv_debugfs_init(); register_netdevice_notifier(&batadv_hard_if_notifier); - rtnl_link_register(&batadv_link_ops); + ret = rtnl_link_register(&batadv_link_ops); + if (ret < 0) + return ret; + batadv_netlink_register(); pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n",