usb: gadget: f_fs: Prevent panic due to failure of huge size buffer allocation
authorDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 26 Oct 2018 01:41:41 +0000 (10:41 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 23 Nov 2022 02:23:53 +0000 (11:23 +0900)
commit8cddd07976261b48f8558251650b1d53eeb22384
tree2c98b1f50f1cb57caeb2e83fc86f1b701b675a9a
parent6e393d8fab8dd42ea83ae7d5ed70eb05730311c4
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.

Change-Id: I4df1987a6f07e558772dcc5f6f020cc550fb1b13
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
 Conflicts:
drivers/usb/gadget/function/f_fs.c

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
drivers/usb/gadget/function/f_fs.c