From patchwork Sun Jun 10 14:49:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 10456667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C991660467 for ; Sun, 10 Jun 2018 14:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B974A26E3C for ; Sun, 10 Jun 2018 14:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE51E26E4A; Sun, 10 Jun 2018 14:49:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E3F226E51 for ; Sun, 10 Jun 2018 14:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbeFJOtf (ORCPT ); Sun, 10 Jun 2018 10:49:35 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:38217 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbeFJOte (ORCPT ); Sun, 10 Jun 2018 10:49:34 -0400 Received: by mail-pl0-f65.google.com with SMTP id b14-v6so10872920pls.5 for ; Sun, 10 Jun 2018 07:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RIuY5/Dq+w3vvtO1o8vh+WXYHBnvENz/3QjymeGQj4Y=; b=KQWP9LjCiao38o+nfcmuIhclOAE6/GsRbor9PYbL7DV8yd9WfAsub/TnAwP6nAjcBY ZisP/lEingzQCTODfsi93qFp3+rNbMK7DUhjhvYxlXysxgqVVa2tFrC/5/EqbtYr6Jlz tRKXwgiPYhCJix55Xzjxu9jwGSJAcyb0GFPnwW8LDStkzQbFMMRiOOnrRjpphspO2YOy 3c5MeXdZVC0G/mqmZyp+TafRMDUAiVIhj15OLTEoYu4qaOoppj1QxB2Ba/gBzrJ3ht2t YqoHGx3UkBCBf16z4wuJohU53AoR3nLc41Lc18Y4bGG4neKchnH/JsoCWwe6oZE/Irk7 RYQA== 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; bh=RIuY5/Dq+w3vvtO1o8vh+WXYHBnvENz/3QjymeGQj4Y=; b=EpFNG4SS5d5Yh7VjjMSrvrS9Yd7ppdYCmodQnMR/Hi/VtxGQhrWcrqqOVS0j5CDHOq i8EoxTAg9bKt6mwpJQZv7UsJRRZr/MsgwkVx2I0oAVNjpvUpsJ4RiJOOmu6Ft0HYu0RD 1xHBgdnT6AlctICpVmlqxXxZkeiYsPfd3HrFjk3sDEWtHBEnMpWu2p55vZaqKplHmmht s3ih0QXMQ3P2mSbmy0zTfJhP0zWTB+maCclcgnqF6zfNibIESU0AaqN4pLIw80V7CTGO V+875QW+EKevPgUq4RC1dXryVeGmLmyY/y7pK7GDE/QgfkWjJWTfDu9R+3nyThjMJfGx D59Q== X-Gm-Message-State: APt69E3EVGAmaTGdJPRUk13vUOBAm2RWBTQAmQgNcbRGV8MMA5w6I3tS 7oF0j8bGtvOkxg4KktajajmeRA== X-Google-Smtp-Source: ADUXVKI3KbU1fE+XUljkzG2M5BVY4w6uLkLcT3vLTca+WWwAjKY7W+jjKskIqGYQ5ze9UOO43JM5kA== X-Received: by 2002:a17:902:bd93:: with SMTP id q19-v6mr14523951pls.342.1528642174110; Sun, 10 Jun 2018 07:49:34 -0700 (PDT) Received: from localhost.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by smtp.googlemail.com with ESMTPSA id b22-v6sm9428088pfi.144.2018.06.10.07.49.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jun 2018 07:49:33 -0700 (PDT) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, Akihiro Tsukada Subject: [PATCH] dvb-frontends/dvb-pll: fix module ref-counting Date: Sun, 10 Jun 2018 23:49:15 +0900 Message-Id: <20180610144915.7882-1-tskd08@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Akihiro Tsukada dvb-pll module was 'put' twice on exit: once by dvb_frontend_detach() and another by dvb_module_release(). Signed-off-by: Akihiro Tsukada --- drivers/media/dvb-frontends/dvb-pll.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index e3894ff403d..4a663420190 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -884,6 +884,17 @@ dvb_pll_probe(struct i2c_client *client, const struct i2c_device_id *id) if (!dvb_pll_attach(fe, client->addr, client->adapter, desc_id)) return -ENOMEM; + /* + * Unset tuner_ops.release (== dvb_pll_release) + * which has been just set in the above dvb_pll_attach(), + * because if tuner_ops.release was left defined, + * this module would be 'put' twice on exit: + * once by dvb_frontend_detach() and another by dvb_module_release(). + * + * dvb_pll_release is instead executed in the i2c driver's .remove(), + * keeping dvb_pll_attach untouched for legacy (dvb_attach) drivers. + */ + fe->ops.tuner_ops.release = NULL; dev_info(&client->dev, "DVB Simple Tuner attached.\n"); return 0; }