lkml.org 
[lkml]   [2023]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net v2 1/3] s390/ism: Fix locking for forwarding of IRQs and events to clients
From


On 08.07.23 15:36, Simon Horman wrote:
> On Fri, Jul 07, 2023 at 12:43:57PM +0200, Niklas Schnelle wrote:
[...]
>> @@ -92,6 +102,9 @@ int ism_unregister_client(struct ism_client *client)
>> max_client--;
>> spin_unlock_irqrestore(&clients_lock, flags);
>> list_for_each_entry(ism, &ism_dev_list.list, list) {
>> + spin_lock_irqsave(&ism->lock, flags);
>
> Hi Niklas,
>
> The lock is taken here.
>
>> + /* Stop forwarding IRQs and events */
>> + ism->subs[client->id] = NULL;
>> for (int i = 0; i < ISM_NR_DMBS; ++i) {
>> if (ism->sba_client_arr[i] == client->id) {
>> pr_err("%s: attempt to unregister client '%s'"
>> @@ -101,6 +114,7 @@ int ism_unregister_client(struct ism_client *client)
>> goto out;
>
> But it does not appear to be released
> (by the call to spin_unlock_irqrestore() below)
> if goto out is called here.
>
>> }
>> }
>> + spin_unlock_irqrestore(&ism->lock, flags);
>> }
>> out:
>> mutex_unlock(&ism_dev_list.mutex);
>

Great catch, Simon.
@Niklas, the missing unlock accidentially got moved to "[PATCH net v2 3/3] s390/ism: Do not unregister clients with registered DMBs"

\
 
 \ /
  Last update: 2023-07-10 08:37    [W:0.212 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site