mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-24 08:54:16 +00:00
scst: Remove unnecessary null check
kmem_cache_destroy() can handle NULL pointer correctly, so there is no need
to check NULL pointer before calling kmem_cache_destroy().
For kernel versions before v4.3 there is a backport of
kmem_cache_destroy() that checks for a null pointer.
This patch fixes the following checkpatch warnings:
WARNING:NEEDLESS_IF: kmem_cache_destroy(NULL) is safe and this check
is probably not required
This commit is contained in:
@@ -170,10 +170,8 @@ void isert_global_cleanup(void)
|
||||
isert_portal_list_release_all();
|
||||
if (isert_glob.conn_wq)
|
||||
destroy_workqueue(isert_glob.conn_wq);
|
||||
if (isert_cmnd_cache)
|
||||
kmem_cache_destroy(isert_cmnd_cache);
|
||||
if (isert_conn_cache)
|
||||
kmem_cache_destroy(isert_conn_cache);
|
||||
kmem_cache_destroy(isert_cmnd_cache);
|
||||
kmem_cache_destroy(isert_conn_cache);
|
||||
}
|
||||
|
||||
int isert_get_addr_size(struct sockaddr *sa, size_t *addr_len)
|
||||
|
||||
Reference in New Issue
Block a user