From: Peter Seiderer Date: Tue, 24 Mar 2015 17:30:48 +0000 (-0300) Subject: [media] coda: fix double call to debugfs_remove X-Git-Tag: v4.1-rc1~59^2~1^2~14 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d446ec8e122c210a9260f103cbf8da5a56de9c82;p=karo-tx-linux.git [media] coda: fix double call to debugfs_remove In coda_free_aux_buf() call debugfs_remove only if buffer entry is valid (and therfore dentry is valid), double protect by invalidating dentry value. Fixes erroneous prematurely dealloc of debugfs caused by incorrect reference count incrementing. Signed-off-by: Peter Seiderer Signed-off-by: Philipp Zabel Signed-off-by: Kamil Debski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index c82ce562d95a..2906dd225143 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1215,8 +1215,9 @@ void coda_free_aux_buf(struct coda_dev *dev, buf->vaddr, buf->paddr); buf->vaddr = NULL; buf->size = 0; + debugfs_remove(buf->dentry); + buf->dentry = NULL; } - debugfs_remove(buf->dentry); } static int coda_start_streaming(struct vb2_queue *q, unsigned int count)