diff --git a/[refs] b/[refs] index 496265c9b94e..43cdb2b62b22 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e71ec593201e1b367b5f22955e3db49e3c562e67 +refs/heads/master: 6fd59a83b9261fa53eaf98fb5514abba504a3ea3 diff --git a/trunk/lib/scatterlist.c b/trunk/lib/scatterlist.c index 3675452b23ca..7874b01e816e 100644 --- a/trunk/lib/scatterlist.c +++ b/trunk/lib/scatterlist.c @@ -248,7 +248,8 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents, unsigned int left; #ifndef ARCH_HAS_SG_CHAIN - BUG_ON(nents > max_ents); + if (WARN_ON_ONCE(nents > max_ents)) + return -EINVAL; #endif memset(table, 0, sizeof(*table));