From: Quentin Lambert <lambert.quentin@gmail.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] stm class: Add a missing call to put_device
Date: Mon, 21 Nov 2016 08:58:55 +0100 [thread overview]
Message-ID: <336d516d-a256-fd70-1c08-8c42880a2821@gmail.com> (raw)
In-Reply-To: <87k2bxe194.fsf@ashishki-desk.ger.corp.intel.com>
On 11/21/2016 08:32 AM, Alexander Shishkin wrote:
> Quentin Lambert <lambert.quentin@gmail.com> writes:
>
>> Most error branches following the call to class_find_device contain
>> a call to put_device. This patch add calls to put_device where
>> they are missing.
>>
>> This issue was found with Hector.
>>
>> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
>>
>> ---
>> drivers/hwtracing/stm/core.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> --- a/drivers/hwtracing/stm/core.c
>> +++ b/drivers/hwtracing/stm/core.c
>> @@ -368,8 +368,10 @@ static int stm_char_open(struct inode *i
>> return -ENODEV;
>>
>> stmf = kzalloc(sizeof(*stmf), GFP_KERNEL);
>> - if (!stmf)
>> + if (!stmf) {
>> + put_device(dev);
>> return -ENOMEM;
>> + }
> There is a goto label at the bottom of this function which is supposed
> to deal with this. See the fix that we already have [1] for this issue.
>
> [1] https://git.kernel.org/cgit/linux/kernel/git/ash/stm.git/commit/?h=stm-for-greg-20161118&id=a0ebf519b8a2666438d999c62995618c710573e5
>
> Regards,
> --
> alex
Your fix is better, you are right, I did not use the goto label because
of the free.
Thanks for your feedback though.
Regards,
Quentin
prev parent reply other threads:[~2016-11-21 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-19 18:22 Quentin Lambert
2016-11-21 7:32 ` Alexander Shishkin
2016-11-21 7:58 ` Quentin Lambert [this message]
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=336d516d-a256-fd70-1c08-8c42880a2821@gmail.com \
--to=lambert.quentin@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®