Received: by 10.213.65.68 with SMTP id h4csp1358283imn; Mon, 26 Mar 2018 06:07:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELv/i2lYVgjsUOUU+8uGfPnnqVrRlOpS80EnO9Xwfn6r/2HEzhDJ3arzgWB/gbEtftgJiYWi X-Received: by 10.99.120.74 with SMTP id t71mr28922715pgc.310.1522069636935; Mon, 26 Mar 2018 06:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522069636; cv=none; d=google.com; s=arc-20160816; b=Npg1nXxa9nT8RRnRQHAWpgTEqOGohiQPlB5i5MAQMen+n4h4uKqdAlH7Q5JuH/iDWB wAx0DFHwb7o2QeWcwPozYeU6VPUCVKUXywDUeuxiCQw17lTJkh03FmjN1cA6/a2VEB8c JXKx+9q3QtYAs31Qc3dsmbtS57aA2AovVaimL155Go63jacUIix8I/291o40GytDc+H/ fIbQQoePX0LfKOtFf+Sgs3CXvZPRZiT+o/B7ZHeQKBc5pufm2rQZn6lCOgNmxsCSHcLV 6SpCwpETyHps5z+y2hV8HezkdNVFDnqQ/Qq+DCE8cXF3WBA1xC3vcvTxpCoxmmG4B8tW VwGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :user-agent:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/lGzIRMYBg3GzRZpnV8/6iNbnPEXmaHy0c/ZqZpJZ7s=; b=HN8d6KQwA2N1rsHHbfrpE/ZY/GkaHYupqL6tY2mGtaaZnnikZ7N/AZ1fEP9/Dto1qr b0Rf3Qq+rXiA3vPLJw0ravP8wKrJkvw7Xss/36yid+tIpx3V9Fvf7cnMtJnv0/THNqSX C9J6Byv8c5vWsF075wrmC8Ps2axdPZobd4Tr8oXIXw49VkNN11BVxhJiKJAE2OduC8ga avX4z1RMiUffPt3sLFLK99OlwdYn88VN4jqqKEcx+YbrLmmjxyvjNAFO8pbMnhqMJgB6 xRCPGK0pe1YXEvhVE0J1GplzQqVlUurTm8AMmU5W1yJGSKXM5Z/hNV9uwahfwdGk3ldd Ppog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23-v6si14856583plk.265.2018.03.26.06.07.01; Mon, 26 Mar 2018 06:07:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbeCZNGA (ORCPT + 99 others); Mon, 26 Mar 2018 09:06:00 -0400 Received: from packetmixer.de ([79.140.42.25]:60806 "EHLO mail.mail.packetmixer.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbeCZNF6 (ORCPT ); Mon, 26 Mar 2018 09:05:58 -0400 X-Greylist: delayed 535 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Mar 2018 09:05:58 EDT Received: from prime.localnet (p2003007C6F4CA900618CBC23B295F526.dip0.t-ipconnect.de [IPv6:2003:7c:6f4c:a900:618c:bc23:b295:f526]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mail.packetmixer.de (Postfix) with ESMTPSA id 150F362052; Mon, 26 Mar 2018 14:57:03 +0200 (CEST) From: Simon Wunderlich To: Colin King , "David S . Miller" Cc: Marek Lindner , Antonio Quartulli , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put Date: Mon, 26 Mar 2018 14:57:02 +0200 Message-ID: <6736928.QjjYfqFu7x@prime> User-Agent: KMail/5.2.3 (Linux/4.14.0-3-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: <20180323225350.7350-1-colin.king@canonical.com> References: <20180323225350.7350-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8955457.PBE51fOHfl"; micalg="pgp-sha512"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart8955457.PBE51fOHfl Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, this looks good. David, would you pick this patch directly? Otherwise, I can send a pull request, but right now we would only have this single patch for net-next. Acked-by: Simon Wunderlich Acked-by: Sven Eckelmann (just discussed with Sven offline) Thank you, Simon On Friday, March 23, 2018 10:53:50 PM CEST Colin King wrote: > From: Colin Ian King > > In the case where hard_iface is NULL, the error path may pass a null > pointer to batadv_hardif_put causing a null pointer dereference error. > Avoid this by only calling the function if hard_iface not null. > > Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced") > > Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support") > Signed-off-by: Colin Ian King > --- > net/batman-adv/multicast.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c > index de3a055f7dd8..bd0ea374d043 100644 > --- a/net/batman-adv/multicast.c > +++ b/net/batman-adv/multicast.c > @@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct > netlink_callback *cb, > > if (!ret && primary_if) > *primary_if = hard_iface; > - else > + else if (hard_iface) > batadv_hardif_put(hard_iface); > > return ret; --nextPart8955457.PBE51fOHfl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAlq47h4ACgkQoSvjmEKS nqFH1w//Yp5bHP7Izw/DndQ3ekThi16/0qDVMjbRWWQPTgBehexeXSA9snveR/rU PK1i7EVE0Eu4HSfjTDWJK/X3Ea2gGq4Z7HcHIgEz4nj3TCwhlAOuoGsEKSgE2GLw kfHHQGbIOMjHpjpkqV4r9vIaUwf45SrV5tSZYVmAoycpZ44r9hUVPFOFVCr3qnMe i2h33lEm2rvS80T2gmi/OUmDM9nnBc17F0nYQnYP8UfO9tDihohKcRIZjCueRA8g mtC7S+KGqW3GpeToiuM4gpEaqqUDdHU103Nx8/M+g/JZ3eT1ZsD8oyYax822hz0G /x9r2ISIOMzqh9+8ZrmroyLR2roPvlp09Id8iBQrMdlJFKittm86WB4enc27q3vi Pp3azGy6MK0hcKxwYd59QnTsW2lqSR+S7EABD97MH7uOlGDJj4is1ql/KQuHljIT XZsgQQcrjaxaMHrNbbCFRyu30jm/FG0dkihBYssfvEhQmy2G8P33IvXN1p+7lit2 IDRuEjmEBl3mN+FI4eexHF7MKthH+BM3Md4gh7k8E9B2vin+AzgD/zoFA1dCKI0h x6TyX4J2Jk85Rqm9wSx3FxkdmrTCgLC2Bn9qU0N3AO07gh2RjejdBKNcMzNRjCGF gIsHTNgDI7JlXxjffFhE5dSx4HHXnAZm7s1g2VOk2hO7kPtWhyQ= =rBOg -----END PGP SIGNATURE----- --nextPart8955457.PBE51fOHfl--