From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Chunyan Zhang <zhang.chunyan@linaro.org>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Lyra Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH] drivers: stm: correct the index in master array release
Date: Mon, 15 Feb 2016 12:34:10 +0200 [thread overview]
Message-ID: <87bn7iclel.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <CAG2=9p-po7j3eKJOLyp-cW8ConH7ODtA09187314rvfj8SScCg@mail.gmail.com>
Chunyan Zhang <zhang.chunyan@linaro.org> writes:
> On Tue, Feb 9, 2016 at 6:12 PM, Alexander Shishkin
> <alexander.shishkin@linux.intel.com> wrote:
>> Chunyan Zhang <zhang.chunyan@linaro.org> writes:
>>
>>> It would be broken if stm_data->sw_start isn't zero, because that
>>> stp_master_free() get the 'master' with __stm_master()/stm_master(),
>>> in which the masterID is the second input parameter minus
>>> stm_data->sw_start. So freeing STM masters has to start from
>>> stm_data->sw_start.
>>
>> No, it won't. stm_master_free() handles nonexistent masters correctly.
>> It does make sense to shrink the loop in stm_unregister_device() to
>> avoid going through the [0..sw_start) range, since stm_master() returns
>> NULL for those, but not for the reasons given in this patch description.
>
> Let's assume sw_start = 64, sw_end = 79, sw_nmasters should be 16, if
> the loop goes through [0..16), the existed masters will not be freed.
Ah yes, you're right, of course.
I'll add this fix to the queue with a proper description.
Thanks,
--
Alex
prev parent reply other threads:[~2016-02-15 10:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 4:21 Chunyan Zhang
2016-02-09 10:12 ` Alexander Shishkin
2016-02-14 6:25 ` Chunyan Zhang
2016-02-15 10:34 ` Alexander Shishkin [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=87bn7iclel.fsf@ashishki-desk.ger.corp.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=zhang.chunyan@linaro.org \
--cc=zhang.lyra@gmail.com \
/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®