mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
usb: host: sl811-hcd: check kzalloc() result
If kzalloc() fails exit with -ENOMEM. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
a93917d39f
commit
76be932af1
1 changed files with 4 additions and 1 deletions
|
@ -813,8 +813,11 @@ static int sl811h_urb_enqueue(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* avoid all allocations within spinlocks */
|
/* avoid all allocations within spinlocks */
|
||||||
if (!hep->hcpriv)
|
if (!hep->hcpriv) {
|
||||||
ep = kzalloc(sizeof *ep, mem_flags);
|
ep = kzalloc(sizeof *ep, mem_flags);
|
||||||
|
if (ep == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&sl811->lock, flags);
|
spin_lock_irqsave(&sl811->lock, flags);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue