From: k.marinushkin@gmail.com (Kirill Marinushkin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] staging: bcm2835-audio: Release resources on module_exit()
Date: Wed, 21 Mar 2018 17:58:06 +0100 [thread overview]
Message-ID: <15cc84cc-a887-7473-d64c-00c23e930e0d@gmail.com> (raw)
In-Reply-To: <CAHp75Vfwpwcc6_somOcSMYwmBhnkSwR7vn2piAZwA1GFkGAJRw@mail.gmail.com>
On 03/21/18 16:03, Andy Shevchenko wrote:
> On Thu, Mar 15, 2018 at 7:57 AM, Kirill Marinushkin
> <k.marinushkin@gmail.com> wrote:
>> On 03/13/18 22:23, Andy Shevchenko wrote:
>>> On Tue, Mar 13, 2018 at 9:34 PM, Kirill Marinushkin
>>> <k.marinushkin@gmail.com> wrote:
>>>> In the current implementation, `rmmod snd_bcm2835` does not release
>>>> resources properly. It causes an oops when trying to list sound devices.
>>>>
>>>> This commit fixes it.
>>> Nice catch!
>>>
>>> See my comments below.
>>>
>>>> static void snd_devm_unregister_child(struct device *dev, void *res)
>>>> {
>>>> struct device *childdev = *(struct device **)res;
>>>> + struct bcm2835_chip *chip = dev_get_drvdata(childdev);
>>>> + struct snd_card *card = chip->card;
>>>> +
>>>> + snd_card_free(card);
>>>> + dev_set_drvdata(childdev, NULL);
>>> AFAIU this is done by device core.
>> Maybe you are right. But I don't know, which function in the device core does it.
>> It is safe to have this line. So, I suggest to keep it.
> Please, remove.
> If you don't know, perhaps you need to spend more time on doing homework?
You are right, I actually should pay more attention to this detail.
I will remove this line and send as a patch v3
> % git grep -n -w dev_set_drvdata -- drivers/base/dd.c
> drivers/base/dd.c:469: dev_set_drvdata(dev, NULL);
> drivers/base/dd.c:499: dev_set_drvdata(dev, NULL);
> drivers/base/dd.c:902: dev_set_drvdata(dev, NULL);
>
> Last one is the point of your interest.
>
next prev parent reply other threads:[~2018-03-21 16:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 5:52 [PATCH] staging: bcm2835-audio: Release resources on module_exit() Kirill Marinushkin
2018-03-06 12:14 ` Greg Kroah-Hartman
2018-03-06 17:42 ` Kirill Marinushkin
2018-03-13 19:34 ` [PATCH v2] " Kirill Marinushkin
2018-03-13 21:23 ` Andy Shevchenko
2018-03-15 5:57 ` Kirill Marinushkin
2018-03-21 15:03 ` Andy Shevchenko
2018-03-21 16:58 ` Kirill Marinushkin [this message]
2018-03-21 18:48 ` [PATCH v3] " Kirill Marinushkin
2018-03-21 19:24 ` Andy Shevchenko
2018-03-21 19:51 ` Kirill Marinushkin
2018-03-22 21:21 ` Kirill Marinushkin
2018-03-22 21:37 ` [PATCH v4] " Kirill Marinushkin
2018-03-23 16:23 ` Andy Shevchenko
2018-03-23 19:22 ` Kirill Marinushkin
2018-03-25 10:33 ` Andy Shevchenko
2018-03-25 10:44 ` Kirill Marinushkin
2018-03-25 13:03 ` Andy Shevchenko
2018-03-25 13:54 ` Kirill Marinushkin
2018-03-23 19:32 ` [PATCH v5] " Kirill Marinushkin
2018-03-25 10:33 ` Andy Shevchenko
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=15cc84cc-a887-7473-d64c-00c23e930e0d@gmail.com \
--to=k.marinushkin@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).