usb: gadget: f_fs: Prevent panic due to failure of huge size buffer allocation 30/307130/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 26 Oct 2018 01:41:41 +0000 (10:41 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 5 Mar 2024 07:41:11 +0000 (08:41 +0100)
commitb41b3fbde09786012a4ecfc0784ccfcfb6e32bbd
treee7c214f286c343e5426d3783d87b4251a76e9519
parent57b752e611d5bd3b40df8c8397de322ceb65c8e0
usb: gadget: f_fs: Prevent panic due to failure of huge size buffer allocation

The f_fs daemons usually use large size buffer for increasing transfer
performance, but it can cause memory allocation failure in case of
that buddy space is fragmented. Since this, instead of just returning
error in this case, give the chance to retry to allocate memory with
a half length in order to prevent daemon crash due to failure of
buffer allocation.

Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
[hoegeun.kwon: rebased and resolved conflicts]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ief5f8256b37b38de14bb333e53c4c4688867d4f6
drivers/usb/gadget/function/f_fs.c