From patchwork Wed Jul 17 00:33:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2828375 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6C5E3C0AB2 for ; Wed, 17 Jul 2013 00:33:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4E9E20254 for ; Wed, 17 Jul 2013 00:33:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 256FF20268 for ; Wed, 17 Jul 2013 00:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278Ab3GQAd1 (ORCPT ); Tue, 16 Jul 2013 20:33:27 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:49342 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755256Ab3GQAd0 (ORCPT ); Tue, 16 Jul 2013 20:33:26 -0400 Received: by mail-bk0-f45.google.com with SMTP id je9so498694bkc.18 for ; Tue, 16 Jul 2013 17:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=Iutept5fNyVykaF4Ax2fsMryTHw15xxEXOVeF5TAkQY=; b=VBKGKUWMpJih9bV/ZnojXhy2RWB4wwGW27Hrzl+4AY32cH+XIBe5WlyBwXOEa4CTsQ xrGx6o5nfMDLRHvWUddqoIpKGHr6ctR/lgZt1hMgRSS305wUmCnYQGjGsAv4tERYcNNu P1zc+DFmf7aw0JWrU658SIN6aFjIcZIjjtHimVR0v16QdLS0Od47ddeQXPcNAGCqNdKv ZZbs2wJjOFnV7Iu9h0F2ZVQ0Mul2cp2LV+sRvlBhqIeekDP9ua2syJMdSug4izQI1ib9 G0UGVdfOKVj4PfNtSeApc1mtCZbPhqyagJ7zC31oW4b2ZOYQJUJxfinkLf4M/hd/rnec CRDA== MIME-Version: 1.0 X-Received: by 10.204.224.77 with SMTP id in13mr630783bkb.24.1374021205153; Tue, 16 Jul 2013 17:33:25 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Tue, 16 Jul 2013 17:33:25 -0700 (PDT) Date: Wed, 17 Jul 2013 08:33:25 +0800 Message-ID: Subject: [PATCH -next] ACPI / dock: fix error return code in dock_add() From: Wei Yongjun To: shaohua.li@intel.com, lenb@kernel.org, rjw@sisk.pl Cc: yongjun_wei@trendmicro.com.cn, linux-acpi@vger.kernel.org Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Wei Yongjun Fix to return -ENODEV in the acpi notify handler install error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/acpi/dock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 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/dock.c b/drivers/acpi/dock.c index f601658..b527c1b 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -881,8 +881,10 @@ static int __init dock_add(acpi_handle handle) status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, dock_notify_handler, dock_station); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status)) { + ret = -ENODEV; goto err_rmgroup; + } dock_station_count++; list_add(&dock_station->sibling, &dock_stations);