mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
usb: chipidea: usb2: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case, as already done few lines below for another memory allocation. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a1279ef74e
commit
49ca2eff57
1 changed files with 2 additions and 0 deletions
|
@ -52,6 +52,8 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
if (!ci_pdata) {
|
if (!ci_pdata) {
|
||||||
ci_pdata = devm_kmalloc(dev, sizeof(*ci_pdata), GFP_KERNEL);
|
ci_pdata = devm_kmalloc(dev, sizeof(*ci_pdata), GFP_KERNEL);
|
||||||
|
if (!ci_pdata)
|
||||||
|
return -ENOMEM;
|
||||||
*ci_pdata = ci_default_pdata; /* struct copy */
|
*ci_pdata = ci_default_pdata; /* struct copy */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue