From 725a70d8a68ef5368652c0c49631fefb361d62cf Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 28 Jun 2013 17:09:17 +0100 Subject: [PATCH] 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-format-patch failed