ANDROID: mm: cma: proper ret type for tasks interrupted by fatal signal

Currently, cma_alloc() checks if the task has fatal signals pending
and simply bail out without updating return type(defaulting to EBUSY).
Update the return type to EINTR when cma allocation fails due to pending
fatal signals.

Bug: 245880180
Change-Id: Ibcef026a3af3417a5a10e0eae51017f477f6ac0f
Signed-off-by: Nikhil V <quic_nprakash@quicinc.com>
This commit is contained in:
Nikhil V
2022-09-09 14:04:17 +05:30
committed by Todd Kjos
parent cbd1dda137
commit 6e161d9045

View File

@@ -486,8 +486,10 @@ struct page *cma_alloc(struct cma *cma, unsigned long count,
spin_unlock_irq(&cma->lock);
if (fatal_signal_pending(current) ||
(gfp_mask & __GFP_NORETRY))
(gfp_mask & __GFP_NORETRY)) {
ret = -EINTR;
break;
}
/*
* Page may be momentarily pinned by some other