From patchwork Sat Jun 5 02:24:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 104374 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o552OsSA012072 for ; Sat, 5 Jun 2010 02:24:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755306Ab0FECYU (ORCPT ); Fri, 4 Jun 2010 22:24:20 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:32921 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755236Ab0FECYN (ORCPT ); Fri, 4 Jun 2010 22:24:13 -0400 Received: by pwj5 with SMTP id 5so227082pwj.19 for ; Fri, 04 Jun 2010 19:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:subject:to:cc:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=68bqrNAexgDHd/cWSt5Rzhm4/t4+6InaVrzQRSb9Y+c=; b=qL1CstmJYqjTEr8EN6GaLeZc6Ajd8wGJQ2JG9dJAZyHqObH4GTkeIG2sAZF3FjNZgG pZvQzYzPHjte+ko/HiYfmqOBMowbriYHdHCI1/z7Sr8i2vPTEXVNomNXGwltEuXYvc2U b9S+vFmgTpBZbIozzRTmXOOQHO85PsEjDMQZc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=lPuUBDRZksnwUxEThvm8WufYvbssy4FFnppngFFGRpLLRSMeMET0YFsEKL194woKXr ak0KmnePpYR3a5TcVvLsl237n0wbPPfMesMEHsMZcmNqCY10ze0RW5bfTT1K3n/jsLBj I3GcZj7DX5TTRWGJwRaIIf2exz+fUTfqsiDV8= Received: by 10.141.124.3 with SMTP id b3mr9520131rvn.123.1275704652488; Fri, 04 Jun 2010 19:24:12 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-24-6-153-206.hsd1.ca.comcast.net [24.6.153.206]) by mx.google.com with ESMTPS id b1sm2913569rvn.14.2010.06.04.19.24.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Jun 2010 19:24:11 -0700 (PDT) From: Dmitry Torokhov Subject: [PATCH 2/2] PNPACPI: check return value of pnp_add_device() To: Bjorn Helgaas , Len Brown Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Date: Fri, 04 Jun 2010 19:24:10 -0700 Message-ID: <20100605022410.25768.42826.stgit@localhost.localdomain> In-Reply-To: <20100605022058.25768.77560.stgit@localhost.localdomain> References: <20100605022058.25768.77560.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 05 Jun 2010 02:24:54 +0000 (UTC) diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 2029cb5..8c5142d 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -171,8 +171,9 @@ static char *pnpacpi_get_id(struct acpi_device *device) static int __init pnpacpi_add_device(struct acpi_device *device) { - acpi_handle temp = NULL; + acpi_handle temp; acpi_status status; + int error; struct pnp_dev *dev; char *pnpid; struct acpi_hardware_id *id; @@ -233,10 +234,16 @@ static int __init pnpacpi_add_device(struct acpi_device *device) /* clear out the damaged flags */ if (!dev->active) pnp_init_resources(dev); - pnp_add_device(dev); + + error = pnp_add_device(dev); + if (error) { + put_device(&dev->dev); + return error; + } + num++; - return AE_OK; + return 0; } static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle,