Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759193AbZAMBcY (ORCPT ); Mon, 12 Jan 2009 20:32:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758141AbZAMB3E (ORCPT ); Mon, 12 Jan 2009 20:29:04 -0500 Received: from kroah.org ([198.145.64.141]:35971 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758101AbZAMB3A (ORCPT ); Mon, 12 Jan 2009 20:29:00 -0500 Date: Mon, 12 Jan 2009 17:27:04 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Maciej Sosnowski , Dan Williams Subject: [patch 08/21] dmaengine: protect id from concurrent registrations Message-ID: <20090113012704.GI4512@kroah.com> References: <20090113012006.063755472@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="dmaengine-protect-id-from-concurrent-registrations.patch" In-Reply-To: <20090113012633.GA4512@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1167 Lines: 37 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Dan Williams commit b0b42b16ff2b90f17bc1a4308366c9beba4b276e upstream. There is a possibility to have two devices registered with the same id. Acked-by: Maciej Sosnowski Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/dma/dmaengine.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -388,7 +388,10 @@ int dma_async_device_register(struct dma init_completion(&device->done); kref_init(&device->refcount); + + mutex_lock(&dma_list_mutex); device->dev_id = id++; + mutex_unlock(&dma_list_mutex); /* represent channels in sysfs. Probably want devs too */ list_for_each_entry(chan, &device->channels, device_node) { -- 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/