From patchwork Sun Dec 17 15:40:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10117743 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 1DD0F605B4 for ; Sun, 17 Dec 2017 15:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24806292A1 for ; Sun, 17 Dec 2017 15:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19576293AD; Sun, 17 Dec 2017 15:41:05 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 4A0CC293A2 for ; Sun, 17 Dec 2017 15:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752558AbdLQPk6 (ORCPT ); Sun, 17 Dec 2017 10:40:58 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44629 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392AbdLQPk4 (ORCPT ); Sun, 17 Dec 2017 10:40:56 -0500 Received: by mail-wr0-f195.google.com with SMTP id w95so1032973wrc.11 for ; Sun, 17 Dec 2017 07:40:56 -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:in-reply-to:references; bh=Ra3gCfSuIsI2A2GzG0f5jQHlDUkvXt0KnkeAjz4M7hs=; b=Z/2oW14AN+fWMPyg3bzdmdWkHkuo6Lz2cG9AjgsMcgWCxHr2NYtPP+cLCquCYbia5i EDzTZau+VVhij0IjQA6NJhywjzDAKyyhT/0tIqo9vU4o67T/5wVhR4yGB2Yw1W/RAjg8 6yurB3xOkv8kNlrmQ/8kUVf2qZbgxKarJm1520JDDoCfg3zeFhsSLZ+SVvmaokqf596c Tp7ySz1YJtw+VVl3SHx4J8r81OI7NOe8Y/EiLriCOmcbGD+953azMxhCN1sxh3GJvNmo GECLTNhABZK3A0L5vsJNYmRa2k/RzcD73WtEmMcExJedUxp0pmnwFO1cRpz3fv6GDu7j 70zg== 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:in-reply-to :references; bh=Ra3gCfSuIsI2A2GzG0f5jQHlDUkvXt0KnkeAjz4M7hs=; b=PdFIWkMT3hS3TxtyvDzQf+DLzhscP2GhK5ClVW0Hd0v9zm0gpYQvmPX4StusMj39ZN 84gxa1odG65vbh0jGFRzkXuY4fxDwtsYKPRvau68Wo8GxwfIZBPOFB2WICPfv3D6H1Hz HUisdebvPMWcGCbg0KdI/Iy1ps+fTiq+odxY+Qo+knZ8yUwO9paC2vG1KB+r9chNpfnq wxxVN4ukfM5fsA6VJmUodINpxU3WOTvH7itnOBNWgjCgcFRIY6Ee+QsYGwmTTNp4o2oD IYL/4+XDUjdtgj6tOdzA8BJlUhgMUR0aWxcdcqIynUHH4RfHFdqhDpVkjCMBHS3U93PZ OnSA== X-Gm-Message-State: AKGB3mKB88LZCKwmhQJvcj0PobdljOwCE7G5CjWw0KJtQKsVodDIdnwU f3D1yvdA0i04uvMPjAwLC3jirg== X-Google-Smtp-Source: ACJfBouA/ff+8bGNkXcPVX3Fc1Pn/zAs8Ou3l4icQBM6jKMYh9CBU9DO+zOGbLHPkqpnwGDb2VPGhQ== X-Received: by 10.223.201.138 with SMTP id f10mr16296319wrh.9.1513525255493; Sun, 17 Dec 2017 07:40:55 -0800 (PST) Received: from dvbdev.wuest.de (ip-84-118-193-200.unity-media.net. [84.118.193.200]) by smtp.gmail.com with ESMTPSA id m52sm2420974wrm.12.2017.12.17.07.40.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Dec 2017 07:40:54 -0800 (PST) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: Ralph Metzler Subject: [PATCH 2/8] [media] ddbridge: fix resources cleanup for CI hardware Date: Sun, 17 Dec 2017 16:40:43 +0100 Message-Id: <20171217154049.1125-3-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171217154049.1125-1-d.scheller.oss@gmail.com> References: <20171217154049.1125-1-d.scheller.oss@gmail.com> 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: Daniel Scheller Do kfree() on port->en->data instead of port->en. port->en only holds a ptr to a struct dvb_ca_en50221, which is a member either of a memalloc'ed struct ddb_ci (DuoFlex CI, Octopus CI Duo) or a struct cxd (CXD2099AR based Single Flex, allocated by the cxd2099 driver). port->en.data though holds the ptr to the allocated memory, which must rather be kfree()'d. Change this accordingly. Cc: Ralph Metzler Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index eda004398316..a81125d492ff 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -1990,7 +1990,7 @@ void ddb_ports_detach(struct ddb *dev) dvb_unregister_device(port->dvb[0].dev); if (port->en) { dvb_ca_en50221_release(port->en); - kfree(port->en); + kfree(port->en->data); port->en = NULL; } break;