From: Ian Abbott Date: Fri, 28 Jun 2013 16:09:17 +0000 (+0100) Subject: staging: comedi: ni_labpc: fix possible double-free of dma_buffer X-Git-Tag: v3.12-rc1~183^2~731 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=725a70d8a68ef5368652c0c49631fefb361d62cf;p=pandora-kernel.git staging: comedi: ni_labpc: fix possible double-free of dma_buffer If `labpc_attach()` allocates memory for `devpriv->dma_buffer` but fails to request a DMA channel, it frees `devpriv->dma_buffer` but leaves the pointer set. Later, `labpc_detach()` frees `devpriv->dma_buffer` again, which means it has been freed twice in this case. Fix it by only setting `devpriv->dma_buffer` in `labpc_attach()` if the DMA channel was requested successfully. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed