Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932616AbbDWHoy (ORCPT ); Thu, 23 Apr 2015 03:44:54 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40193 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932448AbbDWHor (ORCPT ); Thu, 23 Apr 2015 03:44:47 -0400 X-AuditID: cbfee61b-f79536d000000f1f-2f-5538a2edd155 From: Chao Yu To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org Subject: [PATCH] elevator: remove unneeded kfree in error path of elevator_alloc Date: Thu, 23 Apr 2015 15:44:09 +0800 Message-id: <005601d07d99$5dec4d20$19c4e760$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdB9mHzihnekleAlTZi2JVXxeWhe9A== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t9jQd23iyxCDT4vkbFYfbefzeLyrjls Dkwel8+WenzeJBfAFMVlk5Kak1mWWqRvl8CV8WLeBeaC0ywVPbsvsDUwXmXuYuTkkBAwkXi+ ZBsbhC0mceHeeiCbi0NIYDqjxL0Lj5khnFeMEjfbH7ODVLEJqEgs7/jPBGKLCAhL7O9oZQGx mQUUJH7d28QKYgsLBEjMabsKVsMioCpx4DvEBl4BS4kbC18xQdiCEj8m34Pq1ZJYv/M4E4Qt L7F5zVuo6xQkdpx9zQixS0/i9MItUDXiEhuP3GKZwCgwC8moWUhGzUIyahaSlgWMLKsYRVML kguKk9JzjfSKE3OLS/PS9ZLzczcxgoP1mfQOxlUNFocYBTgYlXh4PxRZhAqxJpYVV+YeYpTg YFYS4RWaChTiTUmsrEotyo8vKs1JLT7EKM3BoiTOO0dXLlRIID2xJDU7NbUgtQgmy8TBKdXA qKrs6Fkuksp9zy324KHn7/isGU0WHtbdNVPloc75zN9uFyfIXFr5LfbjT7bCjbffbeJw/Pzl hPElgUkbRaaX3bxx33HBJcN67/MLX129fWv1+id6pucSHIyu9e1/svRef7IZT7Xo/xhL16Vm 0+VFr4hu7Ihme/RpwetSzXstP6S2TzLOmZJrLqLEUpyRaKjFXFScCACJxwmJUgIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 807 Lines: 30 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 --- block/elevator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/elevator.c b/block/elevator.c index 59794d0..d146a5e 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -166,7 +166,6 @@ struct elevator_queue *elevator_alloc(struct request_queue *q, return eq; err: - kfree(eq); elevator_put(e); return NULL; } -- 2.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/