]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/nand/nandsim.c
mtd: nandsim: bugfix: fail if overridesize is too big
[karo-tx-linux.git] / drivers / mtd / nand / nandsim.c
index cf0cd3146817f9275706f1d4f61b53724d0d5dc1..5d8811809752e86224779982be1f3b5f7f23b3d7 100644 (file)
@@ -2333,6 +2333,7 @@ static int __init ns_init_module(void)
                uint64_t new_size = (uint64_t)nsmtd->erasesize << overridesize;
                if (new_size >> overridesize != nsmtd->erasesize) {
                        NS_ERR("overridesize is too big\n");
+                       retval = -EINVAL;
                        goto err_exit;
                }
                /* N.B. This relies on nand_scan not doing anything with the size before we change it */