Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932918AbbDNPfY (ORCPT ); Tue, 14 Apr 2015 11:35:24 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:33228 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932859AbbDNPfR (ORCPT ); Tue, 14 Apr 2015 11:35:17 -0400 Message-ID: <552D33B0.6040808@6wind.com> Date: Tue, 14 Apr 2015 17:35:12 +0200 From: Nicolas Dichtel Reply-To: nicolas.dichtel@6wind.com Organization: 6WIND User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Patrick McHardy , Honggang Li CC: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, davem@davemloft.net, alex.estrin@intel.com, dledford@redhat.com, edumazet@google.com, erezsh@mellanox.com, maheshb@google.com, jbenc@redhat.com, ebiederm@xmission.com, elfring@users.sourceforge.net, f.fainelli@gmail.com, linux@roeck-us.net, andrew@lunn.ch, sfeldma@gmail.com, alexander.h.duyck@intel.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink References: <1429024817-21561-1-git-send-email-honli@redhat.com> <1429024817-21561-4-git-send-email-honli@redhat.com> <20150414152626.GJ7874@acer.localdomain> In-Reply-To: <20150414152626.GJ7874@acer.localdomain> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 691 Lines: 17 Le 14/04/2015 17:26, Patrick McHardy a ?crit : > On 14.04, Honggang Li wrote: [snip] >> - return vlan->lowerdev->ifindex; >> + if (vlan && vlan->lowerdev) >> + return vlan->lowerdev->ifindex; > > That is completely useless. vlan (=netdev_priv) can not be NULL as > netdev_priv() never returns NULL and vlan->lowerdev is always valid > because a macvlan wouldn't make much sense otherwise. > And I suspect that it is the same for ipvlan and dsa. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/