From patchwork Tue Feb 4 06:40:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 3574241 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E63D59F2E9 for ; Tue, 4 Feb 2014 07:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D5792017B for ; Tue, 4 Feb 2014 07:08:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BFC220176 for ; Tue, 4 Feb 2014 07:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbaBDHIi (ORCPT ); Tue, 4 Feb 2014 02:08:38 -0500 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:29603 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbaBDHIh (ORCPT ); Tue, 4 Feb 2014 02:08:37 -0500 Received: from CMEXHTCAS2.ad.emulex.com (138.239.115.218) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 3 Feb 2014 23:09:06 -0800 Received: from neo01.lab.bg.emulex.com (10.192.204.8) by smtp.emulex.com (138.239.115.208) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Feb 2014 23:08:32 -0800 From: Devesh Sharma To: CC: , , Devesh Sharma Subject: [PATCH master] RDMA/ocrdma: Fix load time panic during GID table init Date: Tue, 4 Feb 2014 12:10:48 +0530 X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Message-ID: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP driver should use rdma_vlan_dev_real_dev() instead of using vlan_dev_real_dev() while building GID table for a vlan interface. Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 91443bc..f7b1b27 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -161,7 +161,9 @@ static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev) rcu_read_lock(); for_each_netdev_rcu(&init_net, tmp) { - if (netdev == tmp || vlan_dev_real_dev(tmp) == netdev) { + if ( + netdev && (netdev == tmp || + rdma_vlan_dev_real_dev(tmp) == netdev)) { if (!netif_running(tmp) || !netif_oper_up(tmp)) continue; if (netdev != tmp) { @@ -208,7 +210,7 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier, is_vlan = netdev->priv_flags & IFF_802_1Q_VLAN; if (is_vlan) { vid = vlan_dev_vlan_id(netdev); - netdev = vlan_dev_real_dev(netdev); + netdev = rdma_vlan_dev_real_dev(netdev); } rcu_read_lock();