Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1484576ybc; Tue, 12 Nov 2019 22:39:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyFIc9/oolIE3ej6prDqQLSMIUfW0Bx+0TjRjfayiaqZ9ELgeoS+c1C83Lzv2JyxDevwg0s X-Received: by 2002:a50:b6e1:: with SMTP id f30mr1857498ede.212.1573627160022; Tue, 12 Nov 2019 22:39:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573627160; cv=none; d=google.com; s=arc-20160816; b=CVKd6isQgLYCOaD8Q8kOj+p6h3Fl9tNWK2M+PTvr1eJya5w7mErl3nDKCBMRAMg0Bh LBUm7un6zH1i3xi/ZlKbmR/htF34PnquxB2Hh/kHGQ5qEZiMUL7ogCnlJREmv5S/raLO nJR4JSXrB9+t2dQ8FXkpOlFqn2E8Es3J6NYV9ddvxrblIwGEprlBCgY9ELJXrCxqsN1I Bngz5TYrwJvVw9sMVEoM3C4tt59mTcqxvLZXG2p4e9ehhHheewH125NlAyTcmi7m9Y8i a8AN6WFEYoBWIrZ1SMt3DsF2mr/NjF3JnQdtLExto2P8v2KtgAMLt36bEY9pQYW04DjW aRLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=hBMWNBe+ajGPyroH9xX0CnOxEfxyrNH26XF/4DoPOfI=; b=fELgttm7qA8NktrVOUwkPr7ZzJ9hdGMUPMjHoFOld/9QIuOIxZAA+g8qWI48NSdPoA SlwA3rIHdgHArC8pz58wGwSinqYmeoOGjfL21EZ5God7FXj29w6u79wqg6v5aAUoTqUO 2Z+HF6E01yQD01EZwK7OB9CbG1s6Zvcw+LRiEduXUJd6i23Mislxukx/KF+ONtJAmHFz qv6ojTOFE7+3rUI0Z2PBtqWbpY8xs6d1vjqbVOU7A6bXqBYPeXCLsUefK4oeZFC493NB UL52NoWvf/Xc7rdJXnobjY4HGf1HFKAML5hjMSjskC9LZ+8teginLUeK01iS9SaJgKUM OPwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=e861HBFa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b49si644156eda.312.2019.11.12.22.38.55; Tue, 12 Nov 2019 22:39:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=e861HBFa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726474AbfKMGho (ORCPT + 99 others); Wed, 13 Nov 2019 01:37:44 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38017 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfKMGho (ORCPT ); Wed, 13 Nov 2019 01:37:44 -0500 Received: by mail-pg1-f194.google.com with SMTP id 15so734253pgh.5; Tue, 12 Nov 2019 22:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hBMWNBe+ajGPyroH9xX0CnOxEfxyrNH26XF/4DoPOfI=; b=e861HBFaQDhUO0OFaRlI921rTJYFWvqygV2ToxRWlZ1iGhl6xTLV+oe+rcw9zefXe4 ivCZCMu/5DO2kblI7BKZABJw8VS9iIUvBp7AZFY6ozBwbIC6lHLYFWGSdaJGKA34yEDX xEkHpFNQFEIDi+8Ne4mspjIlzNpIkmJolzso8GnZYMxF5ugXJZ0M/uZAeIEiv5w+rkCe Bhr2GLEj0uvfxWMrIiAJ2LW9pSVjxzRcUCiKE/C63QmMlt0wSk7eUZJbneYmbDPuWX/j M9nnd/Cvt9txjUKHStew8gOh0SWui+6cvIYJyaTi0WS7tJChPizT8whnqtCZzje36iQv xV0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hBMWNBe+ajGPyroH9xX0CnOxEfxyrNH26XF/4DoPOfI=; b=CPJQB4t6i+WD9mKNiBDAF4UMhUUR2NbKLFtnMormq9rO0J0nPObT6WN5/usNy5jYfq pnkDc2zTERMtHUiOpRQLRQ1Wa+AJHARDFfMNlORTC2b//u/Lc+WmeEhNR66U5oOWMDi2 D/Fy1pd8uO3SVypjOJm7eq/OZmaRnGkrCYMl6f0fKTO9r71HKTb3MoU8tYFTvHYWtn6x Ea1xh24F+6NAjAeEMniuGM9a4BtpGFk50rtEDBGFkxIn6EuO8YPIEXVZ61Cl5VoXs4HT AJ8nJmo6eqjg/wcU0G3kNo2SBxB3+1gpr1kXKaFLLdcuIbIzNjhk3cEj6NsYtX/3jb8f QoPw== X-Gm-Message-State: APjAAAUQwZ+zqQdG5O9C1+SKeSTQ4sGLUd+gLXUlidqLWd1gXIYpOJ3e HWY/D4MGH38rdEx3MocVtS8= X-Received: by 2002:a63:1323:: with SMTP id i35mr1890724pgl.450.1573627063430; Tue, 12 Nov 2019 22:37:43 -0800 (PST) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id c184sm1411329pfc.159.2019.11.12.22.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 22:37:42 -0800 (PST) From: Chuhong Yuan Cc: Fabien Dessenne , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] media: bdisp: add missed destroy_workqueue in remove and probe failure Date: Wed, 13 Nov 2019 14:37:30 +0800 Message-Id: <20191113063730.8776-1-hslester96@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver forgets to call destroy_workqueue when remove and probe fails. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan --- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index e90f1ba30574..4c0b36236a38 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1275,6 +1275,8 @@ static int bdisp_remove(struct platform_device *pdev) if (!IS_ERR(bdisp->clock)) clk_unprepare(bdisp->clock); + destroy_workqueue(bdisp->work_queue); + dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); return 0; @@ -1318,20 +1320,22 @@ static int bdisp_probe(struct platform_device *pdev) bdisp->regs = devm_ioremap_resource(dev, res); if (IS_ERR(bdisp->regs)) { dev_err(dev, "failed to get regs\n"); - return PTR_ERR(bdisp->regs); + ret = PTR_ERR(bdisp->regs); + goto err_wq; } bdisp->clock = devm_clk_get(dev, BDISP_NAME); if (IS_ERR(bdisp->clock)) { dev_err(dev, "failed to get clock\n"); - return PTR_ERR(bdisp->clock); + ret = PTR_ERR(bdisp->clock); + goto err_wq; } ret = clk_prepare(bdisp->clock); if (ret < 0) { dev_err(dev, "clock prepare failed\n"); bdisp->clock = ERR_PTR(-EINVAL); - return ret; + goto err_wq; } res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); @@ -1403,7 +1407,8 @@ static int bdisp_probe(struct platform_device *pdev) err_clk: if (!IS_ERR(bdisp->clock)) clk_unprepare(bdisp->clock); - +err_wq: + destroy_workqueue(bdisp->work_queue); return ret; } -- 2.23.0