All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Fix unneeded NULL check
@ 2018-08-28  7:30 Ding Xiang
  2018-08-28 14:38 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ding Xiang @ 2018-08-28  7:30 UTC (permalink / raw)
  To: axboe, linux-block, linux-kernel

if icq_cache is null, kmem_cache_destroy will do nothing.
So, remove the null check.

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
 block/elevator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 5ea6e7d..6a06b5d 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -895,8 +895,7 @@ int elv_register(struct elevator_type *e)
 	spin_lock(&elv_list_lock);
 	if (elevator_find(e->elevator_name, e->uses_mq)) {
 		spin_unlock(&elv_list_lock);
-		if (e->icq_cache)
-			kmem_cache_destroy(e->icq_cache);
+		kmem_cache_destroy(e->icq_cache);
 		return -EBUSY;
 	}
 	list_add_tail(&e->list, &elv_list);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: Fix unneeded NULL check
  2018-08-28  7:30 [PATCH] block: Fix unneeded NULL check Ding Xiang
@ 2018-08-28 14:38 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-08-28 14:38 UTC (permalink / raw)
  To: Ding Xiang, linux-block, linux-kernel

On 8/28/18 1:30 AM, Ding Xiang wrote:
> if icq_cache is null, kmem_cache_destroy will do nothing.
> So, remove the null check.

Identical patch is already queued up:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-linus&id=62d2a1940709198a522a43ff8be8b8f6b3654dec

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-28 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28  7:30 [PATCH] block: Fix unneeded NULL check Ding Xiang
2018-08-28 14:38 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.