From patchwork Wed Dec 23 12:55:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 560512 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 38770140BEE for ; Wed, 23 Dec 2015 23:55:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 81E9B92652; Wed, 23 Dec 2015 12:55:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhv+N9ICKPi4; Wed, 23 Dec 2015 12:55:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D6DBF925FE; Wed, 23 Dec 2015 12:55:21 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7534B1C0ED1 for ; Wed, 23 Dec 2015 12:55:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 707DAA3A86 for ; Wed, 23 Dec 2015 12:55:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zYkGNjVwLBwu for ; Wed, 23 Dec 2015 12:55:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 9EEB4A2D82 for ; Wed, 23 Dec 2015 12:55:17 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.20,468,1444687200"; d="scan'208";a="193753756" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Dec 2015 13:55:14 +0100 Date: Wed, 23 Dec 2015 13:55:10 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Gangfeng Huang Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Cc: intel-wired-lan@lists.osuosl.org, kbuild-all@01.org Subject: [Intel-wired-lan] [PATCH v2] igb: fix itnull.cocci warnings X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" The index variable of list_for_each_entry_safe should never be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Gangfeng Huang Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall Tested-by: Aaron Brown --- v2: Add sign off igb_cdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/igb/igb_cdev.c +++ b/drivers/net/ethernet/intel/igb/igb_cdev.c @@ -411,8 +411,7 @@ static int igb_close_file(struct inode * list_for_each_entry_safe(userpage, tmp, &adapter->user_page_list, page_node) { - if (userpage) - igb_free_page(adapter, userpage); + igb_free_page(adapter, userpage); } } mutex_unlock(&adapter->user_page_mutex);