Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80394355 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lib/scatterlist: error handling in __sg_alloc_table()"

parents 4fbc86bc 9d225ab3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -247,13 +247,15 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
	struct scatterlist *sg, *prv;
	unsigned int left;

	memset(table, 0, sizeof(*table));

	if (nents == 0)
		return -EINVAL;
#ifndef ARCH_HAS_SG_CHAIN
	if (WARN_ON_ONCE(nents > max_ents))
		return -EINVAL;
#endif

	memset(table, 0, sizeof(*table));

	left = nents;
	prv = NULL;
	do {