Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761775AbZCaQHd (ORCPT ); Tue, 31 Mar 2009 12:07:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756351AbZCaQHY (ORCPT ); Tue, 31 Mar 2009 12:07:24 -0400 Received: from mail.gmx.net ([213.165.64.20]:40035 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756189AbZCaQHW (ORCPT ); Tue, 31 Mar 2009 12:07:22 -0400 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/Q65RHQpjQ23H+cNrHpVdr8/BxA5zm5sIVnnGLO/ C9LOMGEIjx+PpY Date: Tue, 31 Mar 2009 18:07:34 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-kernel@vger.kernel.org cc: Atsushi Nemoto , Dan Williams , Maciej Sosnowski Subject: [PATCH] dmaengine: fix regression introduced by d6103085dfd83c13db65c3bd7e182f021d77c541 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5600000000000001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 35 chan is an index variable, used to loop over a list of channels, and here it is used _after_ the loop, in which case it doesn't point to a DMA channel struct anymore. Dereferencing it leads to a corruption of a random memory location, which in my case was a pointer inside a clock struct. Fix it by using a local variable pointing to the DMA device. Signed-off-by: Guennadi Liakhovetski --- Guys, this was a _real_ bad joke, cost me almost a day, and that patch has been reviewed by two persons... So far 2.6.29(-next) has been very bad for me, regressions all over the place, lots of wasted time hunting them down:-( diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 59e0fb2..92438e9 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -726,7 +726,7 @@ int dma_async_device_register(struct dma_device *device) } list_add_tail_rcu(&device->global_node, &dma_device_list); if (dma_has_cap(DMA_PRIVATE, device->cap_mask)) - chan->device->privatecnt++; /* Always private */ + device->privatecnt++; /* Always private */ dma_channel_rebalance(); mutex_unlock(&dma_list_mutex); -- 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/