(2014/11/19 16:08), SF Markus Elfring wrote:
>>> index 3995f54..f1e7d45 100644
>>> --- a/kernel/kprobes.c
>>> +++ b/kernel/kprobes.c
>>> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p)
>>> out:
>>> mutex_unlock(&kprobe_mutex);
>>>
>>> - if (probed_mod)
>>> - module_pu
>> index 3995f54..f1e7d45 100644
>> --- a/kernel/kprobes.c
>> +++ b/kernel/kprobes.c
>> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p)
>> out:
>> mutex_unlock(&kprobe_mutex);
>>
>> -if (probed_mod)
>> -module_put(probed_mod);
>> +module_put(probed_mod);
>
>
(2014/11/16 21:34), SF Markus Elfring wrote:
> From: Markus Elfring
> Date: Sun, 16 Nov 2014 12:20:31 +0100
>
> The module_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
>
> This issue was detected by using the Cocci
> The if around the module_put is helpful to the reader to understand
> that this possibility exists.
I have got a different opinion. I would still prefer a small code clean-up
there.
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a mes
On Sun, 16 Nov 2014, SF Markus Elfring wrote:
> >> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> >> index 3995f54..f1e7d45 100644
> >> --- a/kernel/kprobes.c
> >> +++ b/kernel/kprobes.c
> >> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p)
> >> out:
> >>mutex_unlock(&kprobe_mu
>> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
>> index 3995f54..f1e7d45 100644
>> --- a/kernel/kprobes.c
>> +++ b/kernel/kprobes.c
>> @@ -1527,8 +1527,7 @@ int register_kprobe(struct kprobe *p)
>> out:
>> mutex_unlock(&kprobe_mutex);
>>
>> -if (probed_mod)
>> -module_put
On Sun, 16 Nov 2014, SF Markus Elfring wrote:
> From: Markus Elfring
> Date: Sun, 16 Nov 2014 12:20:31 +0100
>
> The module_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
>
> This issue was detected by using the Cocci
From: Markus Elfring
Date: Sun, 16 Nov 2014 12:20:31 +0100
The module_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
kernel
8 matches
Mail list logo