Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp299791pxx; Wed, 28 Oct 2020 05:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0ujnylXqj/loRUuy4hcBWu3IThxd3CFumoErIrjn9OGFIzZMQ3U92tbTmR2adUWv142P6 X-Received: by 2002:a17:906:b1d6:: with SMTP id bv22mr7121344ejb.60.1603887680899; Wed, 28 Oct 2020 05:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887680; cv=none; d=google.com; s=arc-20160816; b=EcgihUw5XKj63QUwj5APJr4L8DNG1TJSq2W1SSIJkTCai07QbQdLcqYiFn30BLI7Ag Kd+dYi8o4U1xN3LTyW0wUZDYbmJAW57cmePvb7aILQBDp4nse7AvnK0wDguiTuT0jhOU 7JVd3vH0IGCNHO3aus7J6ntYiNRTLjIXLaPopXvRC3po/HgB1WGfrFf5oQhDdwp+Mw1a qTAAI+7Xmh8qpR9Gqv4gRHLsFXMov5iQvnYh6rIAkeIFLJXlKt0bmgGyfMJPAQt7bdTH wpINw01HM28ICVuBvZRwR+Gu4ZRSnHFjD1T7+K+b9b1pL4xIJbMone1lovpDudtKLbQ2 QwIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PuRS/kaaMdi3Snv+ApftxPlLe2bqvBUr1k6JMLvKJFU=; b=zemjgn4HNh2pWbUX80+vFU6fgg9sGig9k1L1bVmMAUT1yVlR9+14PvavmKibrT7e1Z 5THimizrmmk2l3v8BVaZy2eTuh6D7tYOZ6X4ZYZ5xwfL3t+X0aI0dMO3fiSUu9aoLZin FGOBycKnzGbup+VsxKAjgGQRfA7nFBl5PWHCCrWeMJqN+7m24cG8zZKZ4dFZ65pF/AJR AxkEX/pnuGgeCbuen1Byh/XkZ4bFuLFgS/JA7xUp+k1QdwHd310Mvt60N9HCVfMfC83W 3iNViTgofywlZPVdWa3yTwYh1r5k7dbMZL6UPI5UzIWi8Qg6Ik8Qig1npHWOUDPl9G// WTMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pZ+6bvco; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si3473416ejm.389.2020.10.28.05.20.58; Wed, 28 Oct 2020 05:21:20 -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=pass header.i=@kernel.org header.s=default header.b=pZ+6bvco; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1796522AbgJ0PTL (ORCPT + 99 others); Tue, 27 Oct 2020 11:19:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:52016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1795071AbgJ0PPC (ORCPT ); Tue, 27 Oct 2020 11:15:02 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25EA22224A; Tue, 27 Oct 2020 15:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811701; bh=+8n3zIMFKJL0z8oTl5RIgi6vXA1uqJNn2INj3/z1hNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZ+6bvcoZpkunqYPYDITzejR3i2QHOmaGQowsRMV8CcUVwxPxtaO0amFOz7kvgRw4 ueTYVFhQ86aIhzwbtxBe/x1Vr0NaTbBlbVR8KQ0RjpDWl4BI6ko4kHUdeWeJqx16oF p6zCAucUpHz60KhmH9MGyzBItqSjyC4UAGN1Cuwg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rajendra Nayak , Bjorn Andersson , Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 555/633] media: venus: core: Fix error handling in probe Date: Tue, 27 Oct 2020 14:54:58 +0100 Message-Id: <20201027135548.844764280@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajendra Nayak [ Upstream commit 98cd831088c64aa8fe7e1d2a8bb94b6faba0462b ] 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 Reviewed-by: Bjorn Andersson Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 203c6538044fb..bfcaba37d60fe 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; } -- 2.25.1