From patchwork Fri Nov 8 08:24:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 3156801 Return-Path: X-Original-To: patchwork-linux-acpi@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 CFB589F440 for ; Fri, 8 Nov 2013 08:25:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA78920497 for ; Fri, 8 Nov 2013 08:25:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84F0C2047D for ; Fri, 8 Nov 2013 08:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754041Ab3KHIZx (ORCPT ); Fri, 8 Nov 2013 03:25:53 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:31243 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221Ab3KHIZw (ORCPT ); Fri, 8 Nov 2013 03:25:52 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rA88PjjZ020288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Nov 2013 08:25:46 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA88PgVa011860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Nov 2013 08:25:43 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rA88Pgds004125; Fri, 8 Nov 2013 08:25:42 GMT Received: from elgon.mountain (/41.202.233.179) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Nov 2013 00:25:01 -0800 USER-AGENT: Mutt/1.5.21 (2010-09-15) MIME-Version: 1.0 Message-ID: <20131108082449.GA19368@elgon.mountain> Date: Fri, 8 Nov 2013 00:24:49 -0800 (PST) From: Dan Carpenter To: Len Brown , "Chen, Gong" Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Tony Luck , kernel-janitors@vger.kernel.org Subject: [patch 2/2 v2] ACPI, extlog: remove unneeded NULL check In-Reply-To: <20131107072230.GA32127@gchen.bj.intel.com> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 We dereference extlog_l1_addr before checking if is NULL. It turns out "extlog_l1_addr" pointer can never be NULL when this function is called so I have removed the check. We can remove the "elog_addr" check as well. Signed-off-by: Dan Carpenter Signed-off-by: Chen, Gong --- v2: remove the elog_addr check as well. -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index a6869e1..17da458 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -310,10 +310,8 @@ static void __exit extlog_exit(void) { mce_unregister_decode_chain(&extlog_mce_dec); ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN; - if (extlog_l1_addr) - acpi_os_unmap_memory(extlog_l1_addr, l1_size); - if (elog_addr) - acpi_os_unmap_memory(elog_addr, elog_size); + acpi_os_unmap_memory(extlog_l1_addr, l1_size); + acpi_os_unmap_memory(elog_addr, elog_size); release_mem_region(elog_base, elog_size); release_mem_region(l1_dirbase, l1_size); kfree(elog_buf);