From: Lee Jones Date: Wed, 21 Aug 2013 11:47:03 +0000 (+0100) Subject: usb: musb: ux500: Add check for NULL board data X-Git-Tag: firefly_0821_release~176^2~5474^2~19^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0f2aa8caeaa043f6cbe6281eb72efba5ff860904;p=firefly-linux-kernel-4.4.55.git usb: musb: ux500: Add check for NULL board data Dan Carpenter's automatic Smatch checker found an anomaly in the ux500 MUSB driver, whereby board data was checked before use in all but one occasion. It is believed that it needs to be checked every time. Smatch complaint: drivers/usb/musb/ux500_dma.c:335 ux500_dma_controller_start() error: we previously assumed 'data' could be null (see line 313) Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: Dan Carpenter Signed-off-by: Lee Jones Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c index e51dd9b88e71..3700e9713258 100644 --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -333,7 +333,9 @@ static int ux500_dma_controller_start(struct ux500_dma_controller *controller) if (!ux500_channel->dma_chan) ux500_channel->dma_chan = dma_request_channel(mask, - data->dma_filter, + data ? + data->dma_filter : + NULL, param_array[ch_num]); if (!ux500_channel->dma_chan) {