Skip to content

Commit 06f95e6

Browse files
Wei Yongjunjmberg-intel
authored andcommitted
rfkill: fix error return code in rfkill_gpio_probe()
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 <yongjun_wei@trendmicro.com.cn> [fix some indentation on the way] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 8ceb595 commit 06f95e6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎net/rfkill/rfkill-gpio.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
131131
rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name);
132132
if (IS_ERR(rfkill->pwr_clk)) {
133133
pr_warn("%s: can't find pwr_clk.\n", __func__);
134+
ret = PTR_ERR(rfkill->pwr_clk);
134135
goto fail_shutdown_name;
135136
}
136137
}
@@ -152,9 +153,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
152153
}
153154

154155
rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type,
155-
&rfkill_gpio_ops, rfkill);
156-
if (!rfkill->rfkill_dev)
156+
&rfkill_gpio_ops, rfkill);
157+
if (!rfkill->rfkill_dev) {
158+
ret = -ENOMEM;
157159
goto fail_shutdown;
160+
}
158161

159162
ret = rfkill_register(rfkill->rfkill_dev);
160163
if (ret < 0)

0 commit comments

Comments
 (0)