lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Mar 2018 17:58:06 +0100
From:   Kirill Marinushkin <k.marinushkin@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Eric Anholt <eric@...olt.net>,
        Stefan Wahren <stefan.wahren@...e.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
        Michael Zoran <mzoran@...wfest.net>,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        devel@...verdev.osuosl.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] staging: bcm2835-audio: Release resources on
 module_exit()

On 03/21/18 16:03, Andy Shevchenko wrote:
> On Thu, Mar 15, 2018 at 7:57 AM, Kirill Marinushkin
> <k.marinushkin@...il.com> wrote:
>> On 03/13/18 22:23, Andy Shevchenko wrote:
>>> On Tue, Mar 13, 2018 at 9:34 PM, Kirill Marinushkin
>>> <k.marinushkin@...il.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.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ