Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758129AbbDWO63 (ORCPT ); Thu, 23 Apr 2015 10:58:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbbDWO62 (ORCPT ); Thu, 23 Apr 2015 10:58:28 -0400 From: Jeff Moyer To: Chao Yu Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org Subject: Re: [PATCH] elevator: remove unneeded kfree in error path of elevator_alloc References: <005601d07d99$5dec4d20$19c4e760$@samsung.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Thu, 23 Apr 2015 10:58:25 -0400 In-Reply-To: <005601d07d99$5dec4d20$19c4e760$@samsung.com> (Chao Yu's message of "Thu, 23 Apr 2015 15:44:09 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 30 Chao Yu writes: > 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; > } Acked-by: Jeff Moyer -- 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/