From patchwork Thu Apr 18 00:45:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2457131 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 1AAF1DF23A for ; Thu, 18 Apr 2013 00:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935763Ab3DRApy (ORCPT ); Wed, 17 Apr 2013 20:45:54 -0400 Received: from mail-bk0-f41.google.com ([209.85.214.41]:49022 "EHLO mail-bk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935682Ab3DRApx (ORCPT ); Wed, 17 Apr 2013 20:45:53 -0400 Received: by mail-bk0-f41.google.com with SMTP id i18so1029711bkv.0 for ; Wed, 17 Apr 2013 17:45:52 -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=DxN8RrKWdVaEBQ50U9xiZjQYfquYSeODYs7Y5E2aHxwGyoH/Oy3XPkNiC8Hzk5ZeqB B6E6wTdCPEkEmzzj7tLXx1bEgrpg/h4xgXeIp7loL8tfXWPQw9rGW93W52O4MtmLhuem otXKYvUxEAbAYrQyYnAZevckiets2jckd6GR9YdfbaN5342B7ZbXGbFIf918AJe9OZ5y Lv3R4xJyyLDbkJq9PG6hTmody9YiVcYV+ZphGiYBOrA54g+JjoeN+N2GozAwIlJbh7v2 H7qCNdkOuWKdSgmwEDyQaeUzzJY5Lbyex9kl3peFQfI3zWeg4jP9qLwinWeIZCH6BlfY bHVA== MIME-Version: 1.0 X-Received: by 10.204.172.200 with SMTP id m8mr2945725bkz.7.1366245952492; Wed, 17 Apr 2013 17:45:52 -0700 (PDT) Received: by 10.204.59.202 with HTTP; Wed, 17 Apr 2013 17:45:52 -0700 (PDT) Date: Thu, 18 Apr 2013 08:45:52 +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)