Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbdFGIg7 (ORCPT ); Wed, 7 Jun 2017 04:36:59 -0400 Received: from mail-qk0-f173.google.com ([209.85.220.173]:33586 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbdFGIg4 (ORCPT ); Wed, 7 Jun 2017 04:36:56 -0400 MIME-Version: 1.0 In-Reply-To: <20170607060527.23407-1-jlee@suse.com> References: <20170607060527.23407-1-jlee@suse.com> From: Andy Shevchenko Date: Wed, 7 Jun 2017 11:36:55 +0300 Message-ID: Subject: Re: [PATCH] acpi: handle the acpi hotplug schedule error To: "Lee, Chun-Yi" Cc: "Rafael J . Wysocki" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Lee, Chun-Yi" , Len Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 830 Lines: 28 On Wed, Jun 7, 2017 at 9:05 AM, Lee, Chun-Yi wrote: > Kernel should decrements the reference count of acpi device > when scheduling acpi hotplug work is failed, and also evaluates > _OST to notify BIOS the failure. > - if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type))) > - return; > + if (hotplug_event) { > + if (ACPI_FAILURE(acpi_hotplug_schedule(adev, type))) { > + acpi_bus_put_acpi_device(adev); > + goto err; > + } else { > + return; > + } > + } Wouldn't be simpler to - return; + goto err_put_device; + err_put_device: + acpi_bus_put_acpi_device(adev); err: -- With Best Regards, Andy Shevchenko