From: Markus Elfring <Markus.Elfring@web.de>
To: Xu Wang <vulab@iscas.ac.cn>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
kernel-janitors@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: nvmem: core: Checking the decrementing of reference counters
Date: Sat, 28 Dec 2019 13:25:49 +0100 [thread overview]
Message-ID: <2a95fa07-dfae-54ef-9d19-682bace02e5f@web.de> (raw)
In-Reply-To: <1577438434-9945-1-git-send-email-vulab@iscas.ac.cn>
I have taken another look at the implementation of the function “nvmem_device_release”.
https://elixir.bootlin.com/linux/v5.5-rc3/source/drivers/nvmem/core.c#L421
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/nvmem/core.c?id=bf8d1cd4386535004c4afe7f03d37f9864c9940e#n421
Now I wonder why the statement “put_device(&nvmem->dev)” is performed here
after it was also executed by the function “__nvmem_device_put” before.
How often should the device reference count be decremented (at the end)?
Regards,
Markus
next prev parent reply other threads:[~2019-12-28 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 9:20 [PATCH] nvmem: core: Fix a potential use after free Xu Wang
2019-12-28 11:30 ` Markus Elfring
2019-12-28 12:25 ` Markus Elfring [this message]
2020-01-06 12:35 ` Srinivas Kandagatla
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=2a95fa07-dfae-54ef-9d19-682bace02e5f@web.de \
--to=markus.elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=vulab@iscas.ac.cn \
/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).