From: shuahkh@osg.samsung.com (Shuah Khan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()
Date: Mon, 13 Jun 2016 09:38:38 -0600 [thread overview]
Message-ID: <575ED37E.4010204@osg.samsung.com> (raw)
In-Reply-To: <CABxcv=nT_zp2BkvSV04sqaXmZGnQz=z-cGURDJwUW7hthD6-Fw@mail.gmail.com>
On 06/13/2016 07:42 AM, Javier Martinez Canillas wrote:
> Hello Shuah,
>
> On Wed, Jun 8, 2016 at 9:35 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>> s5p_mfc_remove() fails to release encoder and decoder video devices.
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>> drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> index 274b4f1..af61f54 100644
>> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> @@ -1317,7 +1317,9 @@ static int s5p_mfc_remove(struct platform_device *pdev)
>> destroy_workqueue(dev->watchdog_workqueue);
>>
>> video_unregister_device(dev->vfd_enc);
>> + video_device_release(dev->vfd_enc);
>> video_unregister_device(dev->vfd_dec);
>> + video_device_release(dev->vfd_dec);
>> v4l2_device_unregister(&dev->v4l2_dev);
>> s5p_mfc_release_firmware(dev);
>> vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]);
>> --
>
> Can you please do the remove operations in the inverse order of their
> counterparts? IOW to do the release for both encoder and decoder after
> their unregistration.
>
I considered that. No problem. I will move both release after the
video_unregister_device(dev->vfd_dec), releasing enc first and then
the dec
>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
thanks,
-- Shuah
WARNING: multiple messages have this Message-ID (diff)
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Kamil Debski <k.debski@samsung.com>,
jtp.park@samsung.com,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()
Date: Mon, 13 Jun 2016 09:38:38 -0600 [thread overview]
Message-ID: <575ED37E.4010204@osg.samsung.com> (raw)
In-Reply-To: <CABxcv=nT_zp2BkvSV04sqaXmZGnQz=z-cGURDJwUW7hthD6-Fw@mail.gmail.com>
On 06/13/2016 07:42 AM, Javier Martinez Canillas wrote:
> Hello Shuah,
>
> On Wed, Jun 8, 2016 at 9:35 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>> s5p_mfc_remove() fails to release encoder and decoder video devices.
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>> drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> index 274b4f1..af61f54 100644
>> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> @@ -1317,7 +1317,9 @@ static int s5p_mfc_remove(struct platform_device *pdev)
>> destroy_workqueue(dev->watchdog_workqueue);
>>
>> video_unregister_device(dev->vfd_enc);
>> + video_device_release(dev->vfd_enc);
>> video_unregister_device(dev->vfd_dec);
>> + video_device_release(dev->vfd_dec);
>> v4l2_device_unregister(&dev->v4l2_dev);
>> s5p_mfc_release_firmware(dev);
>> vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]);
>> --
>
> Can you please do the remove operations in the inverse order of their
> counterparts? IOW to do the release for both encoder and decoder after
> their unregistration.
>
I considered that. No problem. I will move both release after the
video_unregister_device(dev->vfd_dec), releasing enc first and then
the dec
>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
thanks,
-- Shuah
next prev parent reply other threads:[~2016-06-13 15:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 1:35 [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove() Shuah Khan
2016-06-09 1:35 ` Shuah Khan
2016-06-13 13:42 ` Javier Martinez Canillas
2016-06-13 13:42 ` Javier Martinez Canillas
2016-06-13 15:38 ` Shuah Khan [this message]
2016-06-13 15:38 ` Shuah Khan
-- strict thread matches above, loose matches on Subject: below --
2016-06-13 19:45 Shuah Khan
2016-06-13 19:45 ` Shuah Khan
2016-06-28 9:57 ` Kamil Debski
2016-06-28 9:57 ` Kamil Debski
2016-06-28 13:39 ` Shuah Khan
2016-06-28 13:39 ` Shuah Khan
2016-06-28 15:55 ` Shuah Khan
2016-06-28 15:55 ` Shuah Khan
2016-06-28 19:27 ` Shuah Khan
2016-06-28 19:27 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=575ED37E.4010204@osg.samsung.com \
--to=shuahkh@osg.samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.