Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933749Ab1D2TKt (ORCPT ); Fri, 29 Apr 2011 15:10:49 -0400 Received: from kroah.org ([198.145.64.141]:50164 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932563Ab1D2S6H (ORCPT ); Fri, 29 Apr 2011 14:58:07 -0400 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Apr 29 11:56:53 2011 Message-Id: <20110429185652.960135164@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 29 Apr 2011 11:55:27 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Liu Yuan , Jens Axboe Subject: [04/55] block, blk-sysfs: Fix an err return path in blk_register_queue() In-Reply-To: <20110429185706.GA12824@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1103 Lines: 40 2.6.38-stable review patch. If anyone has any objections, please let us know. ------------------ From: Liu Yuan commit ed5302d3c25006a9edc7a7fbea97a30483f89ef7 upstream. We do not call blk_trace_remove_sysfs() in err return path if kobject_add() fails. This path fixes it. Signed-off-by: Liu Yuan Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -511,8 +511,10 @@ int blk_register_queue(struct gendisk *d return ret; ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue"); - if (ret < 0) + if (ret < 0) { + blk_trace_remove_sysfs(dev); return ret; + } kobject_uevent(&q->kobj, KOBJ_ADD); -- 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/