]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/scatterlist.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[karo-tx-linux.git] / lib / scatterlist.c
index 3675452b23ca175b612489e362aa7274b75d96a5..7874b01e816e815466ccee3a08387b075503c72f 100644 (file)
@@ -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));