From: Markus Elfring
Date: Sun, 15 Nov 2015 10:40:36 +0100
The kmem_cache_destroy() 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.
> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)
How do you think about to extend an other SmPL
than the existing one should have been renamed to free_exit or
free_unlock_exit
and new one would be unlock_exit.
I chose a smaller change at this place.
I'd just drop this patch.
How do you think about to improve the affected jump labels
a bit more there?
Regards,
Markus
--
To
tcegrp will be NULL and kfree() can handle this just fine
The affected function did not show this API knowledge, did it?
(is not it the whole point of this patchset
- remove the check and just call kfree() even if the pointer is NULL?).
Partly, yes.
And if you wanted another label,
I
From: Markus Elfring elfr...@users.sourceforge.net
Another update suggestion was taken into account after a patch was applied
from static source code analysis.
Markus Elfring (2):
Delete an unnecessary check before the function call kfree
One function call less in tce_iommu_attach_group()
From: Markus Elfring elfr...@users.sourceforge.net
Date: Sun, 28 Jun 2015 17:43:48 +0200
The kfree() 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:
From: Markus Elfring elfr...@users.sourceforge.net
Date: Sun, 28 Jun 2015 17:58:42 +0200
The kfree() function was called even if a previous memory allocation
try failed.
This implementation detail could be improved by the introduction
of another jump label.
Signed-off-by: Markus Elfring
If the null test is needed, the call to cancel_delayed_work_sync would have
already crashed. Normally, the destroy function should only be called
if the init functoin has succeeded, in which case ioapic is not null.
Does your commit message need a small fix?
Regards,
Markus
--
To unsubscribe