mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
usb: dwc3: keystone: check return value
[ Upstream commit 018047a1db
]
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>
This commit is contained in:
parent
afeabec4eb
commit
04030f5931
1 changed files with 4 additions and 0 deletions
|
@ -107,6 +107,10 @@ static int kdwc3_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(kdwc->usbss);
|
||||
|
||||
kdwc->clk = devm_clk_get(kdwc->dev, "usb");
|
||||
if (IS_ERR(kdwc->clk)) {
|
||||
dev_err(kdwc->dev, "unable to get usb clock\n");
|
||||
return PTR_ERR(kdwc->clk);
|
||||
}
|
||||
|
||||
error = clk_prepare_enable(kdwc->clk);
|
||||
if (error < 0) {
|
||||
|
|
Loading…
Reference in a new issue