From patchwork Wed Dec 23 12:52:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 560507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 837CF140BF3 for ; Wed, 23 Dec 2015 23:52:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5FA2E33A94; Wed, 23 Dec 2015 12:52:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cDwhSWVo2JUC; Wed, 23 Dec 2015 12:52:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7BC30328F0; Wed, 23 Dec 2015 12:52:38 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4C6EE1C0ED1 for ; Wed, 23 Dec 2015 12:52:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 497E19264A for ; Wed, 23 Dec 2015 12:52:37 +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 tWjrNH-1Ixav for ; Wed, 23 Dec 2015 12:52:35 +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 whitealder.osuosl.org (Postfix) with ESMTPS id 5715C92640 for ; Wed, 23 Dec 2015 12:52:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.20,468,1444687200"; d="scan'208";a="193753375" 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:52:32 +0100 Date: Wed, 23 Dec 2015 13:52:28 +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] 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 Tested-by: Aaron Brown --- 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);