Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94089d56 authored by Roel Kluin's avatar Roel Kluin Committed by Greg Kroah-Hartman
Browse files

USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy()



Test whether tusb_dma is not NULL before dereferencing

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f7410ced
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ void dma_controller_destroy(struct dma_controller *c)
		}
	}

	if (!tusb_dma->multichannel && tusb_dma && tusb_dma->ch >= 0)
	if (tusb_dma && !tusb_dma->multichannel && tusb_dma->ch >= 0)
		omap_free_dma(tusb_dma->ch);

	kfree(tusb_dma);