mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 17:53:56 +08:00
dlm: NULL check before kmem_cache_destroy is not needed
kmem_cache_destroy(NULL) is safe, so removes NULL check before freeing the mem. This patch also fix ifnullfree.cocci warnings. Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
8fc6ed9a35
commit
f31a896928
@ -38,9 +38,7 @@ int __init dlm_memory_init(void)
|
||||
|
||||
void dlm_memory_exit(void)
|
||||
{
|
||||
if (lkb_cache)
|
||||
kmem_cache_destroy(lkb_cache);
|
||||
if (rsb_cache)
|
||||
kmem_cache_destroy(rsb_cache);
|
||||
}
|
||||
|
||||
@ -86,7 +84,6 @@ void dlm_free_lkb(struct dlm_lkb *lkb)
|
||||
struct dlm_user_args *ua;
|
||||
ua = lkb->lkb_ua;
|
||||
if (ua) {
|
||||
if (ua->lksb.sb_lvbptr)
|
||||
kfree(ua->lksb.sb_lvbptr);
|
||||
kfree(ua);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user