From patchwork Thu Jul 30 16:19:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 38345 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6UGG6GT010134 for ; Thu, 30 Jul 2009 16:16:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbZG3QQE (ORCPT ); Thu, 30 Jul 2009 12:16:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751370AbZG3QQE (ORCPT ); Thu, 30 Jul 2009 12:16:04 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:62797 "EHLO mail-ew0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbZG3QQD (ORCPT ); Thu, 30 Jul 2009 12:16:03 -0400 Received: by ewy10 with SMTP id 10so874126ewy.37 for ; Thu, 30 Jul 2009 09:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=l/ONcVg6HtuxISV5SsS56QlbvYJjZth30sNyhs95xNM=; b=RIOlRZEZaxfvScRzZD+Hr2oiDovZG3oZLLbIZ9kIkvDO/Sal6QPVAnvVGJDSSb+4YL hJpc4xYBrb9etpTD8Lvrc5abNhzapQ7Swq4/3eIumOiDOU35DKiqvGh0MoMSt6tBthLa AS6nIbVzX3rN15lYAOOMbrHNnS7ZLS5pVIWpg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=g0QnxPuUj4ZUY7cEIJmU6sjphgEu7v7aEWzaqoggFIZozAl+WQh4OmuBLbQuFhaUTX Vc4p+G96OGqiXGQblPiyR5LufiLIGfrCLAs1kXbd8418rvm+CZ2QeMRoUu2VNE+oVRD0 0KJNja7UrU4abb6Mejdyb/UAgdhkPs0LP0YRI= Received: by 10.210.57.3 with SMTP id f3mr1858961eba.94.1248970562513; Thu, 30 Jul 2009 09:16:02 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 28sm1085851eye.54.2009.07.30.09.16.01 (version=SSLv3 cipher=RC4-MD5); Thu, 30 Jul 2009 09:16:01 -0700 (PDT) Message-ID: <4A71C7F4.9000304@gmail.com> Date: Thu, 30 Jul 2009 18:19:00 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: lenb@kernel.org, linux-acpi@vger.kernel.org Subject: ACPI: Missing test after ioremap()? Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Isn't a test missing after the ioremap()? and if so can we error out like this? --- 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/osl.c b/drivers/acpi/osl.c index 7167071..b1eeecc 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -496,6 +496,9 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) void __iomem *virt_addr; virt_addr = ioremap(phys_addr, width); + if (virt_addr == NULL) + return AE_ERROR; + if (!value) value = &dummy; @@ -524,6 +527,8 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) void __iomem *virt_addr; virt_addr = ioremap(phys_addr, width); + if (virt_addr == NULL) + return AE_ERROR; switch (width) { case 8: