Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1255565ybh; Thu, 23 Jul 2020 04:30:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVWA5tk+n6JJ2Rd390bHDnJmY8p8JZ97kphXLiG84FgNncpNDFy+NyFoR96Joz9lzctuRF X-Received: by 2002:a17:906:3850:: with SMTP id w16mr4097236ejc.205.1595503857430; Thu, 23 Jul 2020 04:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595503857; cv=none; d=google.com; s=arc-20160816; b=AclQiPuRK+PE4Wk4SglCW3cPgS5sYZrlRshi2YZPymrjRHgOmMfGTm0GKRt8zXRR+M eP1tAGhJQFP6wksYBcMoWUqsl2sXVIQZrOSjhcQWG9lyK0KV1ICCREoz8IZg9w+9dEB8 AsYo+kRrO5xgEEGf8u84pJ/KbmgSIw+heMwBH1DYfQXzxRMN8CTQSFRF2WVCrV3YVk5l bl3Yin3GoDAP6ZRs9dK7UPZCLuWBb2NFn2LQAGrXd4kQo5Qhq0XoGewZL8PTS8wegXq5 wCqC2VOp7VJqDS0LjuKyGBHrha5EIEJYwGeLPZ/ToYP5xczKLGLtNKSR0OoJC5ocWtNG poJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=MOuUpg+RsZZ6Dijxt0uuA6eqckA+O2zG103ZtZ+NQvI=; b=AJCIRUZY1VzYazlKUN0inhW8LPIdRsS33j3Kb3X3+huAxxJgFxbpq2Qu0RCZdquqUW LNuJercwSxHwAMqamF+HG5ocYhU0ETS3y53r+wFUupTnA6BfE1fgY6K9ZgSsQrIzzEIB EcAxMLRUTjNeoRTCLNZUg6S8JSEi6467UOVkJK0kf6FfgMTtBHpc0mecF0O19xYio/gD FC642ouUIEr0OcSelcoIH6JxAhleeUqKQDhozBR0ukKrXclkiLXNEa4ChBmK9BSFpCf0 LXUj6tmmDQQ/Cvh7WnTh5ZRyPjbS4zNVy4hnZQHkghQJVLvNCNr5jRvy5+2X57IAnVV9 rX9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=XwV8Ppgy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si1795710edq.340.2020.07.23.04.30.34; Thu, 23 Jul 2020 04:30:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=XwV8Ppgy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbgGWL1s (ORCPT + 99 others); Thu, 23 Jul 2020 07:27:48 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:17270 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbgGWL1q (ORCPT ); Thu, 23 Jul 2020 07:27:46 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595503666; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=MOuUpg+RsZZ6Dijxt0uuA6eqckA+O2zG103ZtZ+NQvI=; b=XwV8Ppgy2CF9U4Kv5VkEu69ZL3B/X/Etc3eHAAcPH6NlTtDdi8gzVkC4lXZRJPz6X8naxIqe ztbDTtzawh/qKitFkX52OlvQuuCE6bCGoOuIBwdAwOlgVQBZ5nWgT342+J+9tvDKTIMcebcl 4dgmlMVQ7MtqEnyFf2oHqhhbd+o= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5f19741f3dbcb593a933ca8e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 23 Jul 2020 11:27:27 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id D1750C433C9; Thu, 23 Jul 2020 11:27:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=ham autolearn_force=no version=3.4.0 Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak) by smtp.codeaurora.org (Postfix) with ESMTPSA id B3057C43395; Thu, 23 Jul 2020 11:27:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B3057C43395 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: stanimir.varbanov@linaro.org, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mka@chromium.org, Rajendra Nayak Subject: [PATCH v4 2/5] media: venus: core: Fix error handling in probe Date: Thu, 23 Jul 2020 16:56:49 +0530 Message-Id: <1595503612-2901-3-git-send-email-rnayak@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595503612-2901-1-git-send-email-rnayak@codeaurora.org> References: <1595503612-2901-1-git-send-email-rnayak@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Post a successful pm_ops->core_get, an error in probe should exit by doing a pm_ops->core_put which seems to be missing. So fix it. Signed-off-by: Rajendra Nayak --- drivers/media/platform/qcom/venus/core.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 203c653..bfcaba3 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -224,13 +224,15 @@ static int venus_probe(struct platform_device *pdev) ret = dma_set_mask_and_coherent(dev, core->res->dma_mask); if (ret) - return ret; + goto err_core_put; if (!dev->dma_parms) { dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms), GFP_KERNEL); - if (!dev->dma_parms) - return -ENOMEM; + if (!dev->dma_parms) { + ret = -ENOMEM; + goto err_core_put; + } } dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); @@ -242,11 +244,11 @@ static int venus_probe(struct platform_device *pdev) IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "venus", core); if (ret) - return ret; + goto err_core_put; ret = hfi_create(core, &venus_core_ops); if (ret) - return ret; + goto err_core_put; pm_runtime_enable(dev); @@ -302,6 +304,9 @@ static int venus_probe(struct platform_device *pdev) pm_runtime_set_suspended(dev); pm_runtime_disable(dev); hfi_destroy(core); +err_core_put: + if (core->pm_ops->core_put) + core->pm_ops->core_put(dev); return ret; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation