Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755614AbbLAJG0 (ORCPT ); Tue, 1 Dec 2015 04:06:26 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34304 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753697AbbLAJGU (ORCPT ); Tue, 1 Dec 2015 04:06:20 -0500 From: Sudip Mukherjee To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] clk: qcom: common: check for failure Date: Tue, 1 Dec 2015 14:36:10 +0530 Message-Id: <1448960770-10815-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 46 We were not checking the return from devm_add_action() which can fail. Signed-off-by: Sudip Mukherjee --- drivers/clk/qcom/common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c index c112eba..3541a9a 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -213,7 +213,10 @@ int qcom_cc_really_probe(struct platform_device *pdev, if (ret) return ret; - devm_add_action(dev, qcom_cc_del_clk_provider, pdev->dev.of_node); + ret = devm_add_action(dev, qcom_cc_del_clk_provider, + pdev->dev.of_node); + if (ret) + return ret; reset = &cc->reset; reset->rcdev.of_node = dev->of_node; @@ -236,8 +239,12 @@ int qcom_cc_really_probe(struct platform_device *pdev, return ret; } - devm_add_action(dev, qcom_cc_gdsc_unregister, dev); - + ret = devm_add_action(dev, qcom_cc_gdsc_unregister, dev); + if (ret) { + if (desc->gdscs && desc->num_gdscs) + gdsc_unregister(dev); + return ret; + } return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/