[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAABZP2zrLqTRu4sTbYSQ58G1SHGR_YhdGC7365aVmyq6q1n_dg@mail.gmail.com>
Date: Tue, 18 Mar 2014 09:24:55 +0800
From: Zhouyi Zhou <zhouzhouyi@...il.com>
To: Gerald Schaefer <gerald.schaefer@...ibm.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-s390@...r.kernel.org, joe@...ches.com, gang.chen@...anux.com,
linux390@...ibm.com, heiko.carstens@...ibm.com,
schwidefsky@...ibm.com, Zhouyi Zhou <yizhouzhou@....ac.cn>
Subject: Re: [PATCH] s390: correct misuses of module_put in appldata_generic_handler.
Thanks Gerald for reviewing and sorry for not elaborated it in the e-mail.
Firstly, I think you can't call module_put after fail try_module_get
Secondly, there exists duplicate module_put on the program path (the last
one is before return 0)
On Mon, Mar 17, 2014 at 9:28 PM, Gerald Schaefer
<gerald.schaefer@...ibm.com> wrote:
> On Sat, 15 Mar 2014 21:35:40 +0800
> Zhouyi Zhou <zhouzhouyi@...il.com> wrote:
>
>> correct misuses of module_put in appldata_generic_handler
>
> Sorry, I don't see any misuse, could you elaborate?
>
>>
>> Signed-off-by: Zhouyi Zhou <yizhouzhou@....ac.cn>
>> ---
>> arch/s390/appldata/appldata_base.c | 3 ---
>> 1 file changed, 3 deletions(-)
>>
>> diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
>> index 47c8630..683e0282 100644
>> --- a/arch/s390/appldata/appldata_base.c
>> +++ b/arch/s390/appldata/appldata_base.c
>> @@ -343,7 +343,6 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
>> // protect work queue callback
>> if (!try_module_get(ops->owner)) {
>> mutex_unlock(&appldata_ops_mutex);
>> - module_put(ops->owner);
>> return -ENODEV;
>> }
>> ops->callback(ops->data); // init record
>> @@ -354,7 +353,6 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
>> if (rc != 0) {
>> pr_err("Starting the data collection for %s "
>> "failed with rc=%d\n", ops->name, rc);
>> - module_put(ops->owner);
>> } else
>> ops->active = 1;
>> } else if ((buf[0] == '0') && (ops->active == 1)) {
>> @@ -365,7 +363,6 @@ appldata_generic_handler(struct ctl_table *ctl, int write,
>> if (rc != 0)
>> pr_err("Stopping the data collection for %s "
>> "failed with rc=%d\n", ops->name, rc);
>> - module_put(ops->owner);
>> }
>> mutex_unlock(&appldata_ops_mutex);
>> out:
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists