]> www.infradead.org Git - users/jedix/linux-maple.git/commit
staging: comedi: das1800: fix possible NULL dereference
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 8 Apr 2016 17:14:58 +0000 (10:14 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:21:53 +0000 (17:21 -0500)
commitabd34b475abf8e2b7c9ea2e6fe7ef3de6fd7ad17
tree092eea5c54763aea0c52390e4da75f5d197fde8f
parent402661daa9557841addb936fdb9a71b0d45a241c
staging: comedi: das1800: fix possible NULL dereference

Orabug: 25256919

[ Upstream commit d375278d666760e195693b57415ba0a125cadd55 ]

DMA is optional with this driver. If it was not enabled the devpriv->dma
pointer will be NULL.

Fix the possible NULL pointer dereference when trying to disable the DMA
channels in das1800_ai_cancel() and tidy up the comments to fix the
checkpatch.pl issues:
WARNING: line over 80 characters

It's probably harmless in das1800_ai_setup_dma() because the 'desc' pointer
will not be used if DMA is disabled but fix it there also.

Fixes: 99dfc3357e98 ("staging: comedi: das1800: remove depends on ISA_DMA_API limitation")
Cc: <stable@vger.kernel.org> # 4.0+
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 788da6ee7dc349b45047212f7dbce31e3fdc82b0)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/staging/comedi/drivers/das1800.c