Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kulikov Vasiliy and committed by
Greg Kroah-Hartman
76be932a a93917d3

+4 -1
+4 -1
drivers/usb/host/sl811-hcd.c
··· 813 813 #endif 814 814 815 815 /* avoid all allocations within spinlocks */ 816 - if (!hep->hcpriv) 816 + if (!hep->hcpriv) { 817 817 ep = kzalloc(sizeof *ep, mem_flags); 818 + if (ep == NULL) 819 + return -ENOMEM; 820 + } 818 821 819 822 spin_lock_irqsave(&sl811->lock, flags); 820 823