usb: dwc3: keystone: check return value
authorPan Bian <bianpan2016@163.com>
Sun, 23 Apr 2017 05:55:13 +0000 (13:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:47:58 +0000 (19:47 +0200)
commit04030f5931b40e9c627b5fea9ac515d5e3d827c3
tree7eff63e90aab97fba8b18f81197bc055d11eb263
parentafeabec4eb81100ab194cd515dbe0456e84a00f1
usb: dwc3: keystone: check return value

[ Upstream commit 018047a1dba7636e1f7fdae2cc290a528991d648 ]

Function devm_clk_get() returns an ERR_PTR when it fails. However, in
function kdwc3_probe(), its return value is not checked, which may
result in a bad memory access bug. This patch fixes the bug.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-keystone.c