From patchwork Thu Apr 18 02:31:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2457251 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0789DDF23A for ; Thu, 18 Apr 2013 02:31:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964942Ab3DRCbS (ORCPT ); Wed, 17 Apr 2013 22:31:18 -0400 Received: from mail-we0-f181.google.com ([74.125.82.181]:60659 "EHLO mail-we0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964925Ab3DRCbS (ORCPT ); Wed, 17 Apr 2013 22:31:18 -0400 Received: by mail-we0-f181.google.com with SMTP id r6so1729141wey.40 for ; Wed, 17 Apr 2013 19:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=Wh0AgmskJjE4y6eyBGLhw7rRYFq223um9BtYQ530UW4=; b=hHSbGFx/NdXtkuuLnlkbDUiKVRy8Nv7vm9iGiCWJuLoQ7GDoGgiG0zi8rVP0LV1gRT bqxXLfaU0WAGdCotaP07B0szKatUczDVjGC2pZkpbqhfE7WhDp7eopR0QddWUr3LfOiV 67wl7OenQTVc7YHp3R4AYePw4WSQ8+g47cwc2I7jjBabz24CXDRccPDcZWEJkSWt/DdM GZjhpW34POxllwVOvugOAXSi7gj9Fsld8Q3A10eGQXR/B2O2ZmBGS8wmUCOn3Lf91Y+o i780Y8f2QE5UuCWoOBjbHZzK/JEaNvImlvwmty0Y7+sHmLztpSgrvehJj7EXjnDm033b c0gA== MIME-Version: 1.0 X-Received: by 10.194.176.195 with SMTP id ck3mr15293435wjc.5.1366252276721; Wed, 17 Apr 2013 19:31:16 -0700 (PDT) Received: by 10.194.51.1 with HTTP; Wed, 17 Apr 2013 19:31:16 -0700 (PDT) Date: Thu, 18 Apr 2013 10:31:16 +0800 Message-ID: Subject: [PATCH] net: rfkill: fix error return code in rfkill_gpio_probe() From: Wei Yongjun To: johannes@sipsolutions.net, linville@tuxdriver.com Cc: yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun --- net/rfkill/rfkill-gpio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 78fc093..6d75e73 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -131,6 +131,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name); if (IS_ERR(rfkill->pwr_clk)) { pr_warn("%s: can't find pwr_clk.\n", __func__); + ret = PTR_ERR(rfkill->pwr_clk); goto fail_shutdown_name; } } @@ -153,8 +154,10 @@ static int rfkill_gpio_probe(struct platform_device *pdev) rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type, &rfkill_gpio_ops, rfkill); - if (!rfkill->rfkill_dev) + if (!rfkill->rfkill_dev) { + ret = -ENOMEM; goto fail_shutdown; + } ret = rfkill_register(rfkill->rfkill_dev); if (ret < 0)