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:
Gleb Chesnokov
2022-08-09 19:38:00 +03:00
parent 4649a6abd4
commit ebae8bd223
3 changed files with 6 additions and 13 deletions
+2 -4
View File
@@ -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)