Commit 76be932a authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

usb: host: sl811-hcd: check kzalloc() result

If kzalloc() fails exit with -ENOMEM.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a93917d3
......@@ -813,8 +813,11 @@ static int sl811h_urb_enqueue(
#endif
/* avoid all allocations within spinlocks */
if (!hep->hcpriv)
if (!hep->hcpriv) {
ep = kzalloc(sizeof *ep, mem_flags);
if (ep == NULL)
return -ENOMEM;
}
spin_lock_irqsave(&sl811->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment