elevator: remove unneeded kfree in error path of elevator_alloc
PATCH 1/1 elevator: remove unneeded kfree in error path of elevator_alloc
In elevator_alloc, if we fail to allocate memory for storing elevator queue, our eq pointer must be NULL, we do not need to release it in error path, so remove it.
Signed-off-by Chao Yu <[email protected]>
--- block/elevator.c | 1 - 1 file changed, 1 deletion(-)
block/elevator.c +0 -1
@@ -166,7 +166,6 @@ struct elevator_queue *elevator_alloc(struct request_queue *q,return eq; err: -kfree (eq);elevator_put (e);return NULL ; }
Signature · 1 line
2.3.3
Quoted 14 lines · Chao Yu
In
elevator_alloc, if we fail to allocate memory for storing elevator queue, our eq pointer must be NULL, we do not need to release it in error path, so remove it.Signed-off-by Chao Yu <[email protected]>--- block/elevator.c | 1 - 1 file changed, 1 deletion(-)block/elevator.c +0
-0
block/elevator.c struct elevator_queue *elevator_alloc(struct request_queue *q, · line 171
Quoted 7 lines
block/elevator.c +0
-1@@ -166,7 +166,6 @@ struct elevator_queue *elevator_alloc(struct request_queue *q,return eq; err: -kfree (eq);elevator_put (e);return NULL ; }
Acked-by Jeff Moyer <[email protected]>